Cloud Cost Optimization

GCP billing export and GKE cost analysis: a worked example

A read-only BigQuery starting query and a GKE investigation workflow with explicit billing, allocation and reliability limitations.

Written by ARCO engineering · Engineering guidePrepared Last updated 2 min read Back to insights

This is an illustrative Google Cloud analysis walkthrough, not an executed ARCO lab or a client savings result. Start by reconciling billing exports, then connect project and GKE allocation data to workload behavior before proposing changes.

Practical artifact

Cloud savings assessment register

Read the HTML instructions and download the blank CSV without registration.

01 · Analysis

Establish export coverage and the cost basis

Confirm the export dataset, table type, currency, billing account scope and history available. Record when the export was enabled and investigate gaps or late data before comparing periods. Use a restricted analysis identity and avoid copying detailed billing records into broadly accessible collaboration tools.

The starting query below groups daily usage by project and service and adds the credits associated with each row. It illustrates a cost-plus-credits view, not a complete finance reconciliation. Check invoice month, adjustments, tax, rounding and contract-specific treatment separately. Select explicit dates and inspect estimated bytes before running a query that may incur BigQuery charges.

-- Adapt dataset/table and dates after checking export schema and coverage.
SELECT DATE(usage_start_time) AS usage_day, project.id AS project_id,
       service.description AS service, currency,
       SUM(cost) AS gross_cost,
       SUM(IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) c), 0)) AS credits,
       SUM(cost + IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) c), 0)) AS net_cost
FROM `YOUR_PROJECT.YOUR_DATASET.YOUR_DETAILED_EXPORT_TABLE`
WHERE usage_start_time >= TIMESTAMP('2026-09-01')
  AND usage_start_time < TIMESTAMP('2026-10-01')
GROUP BY usage_day, project_id, service, currency;
Google Cloud detailed billing export schema.
02 · Analysis

Reconcile before drilling into namespaces

Compare totals with the agreed billing report and investigate unexplained discrepancies. Do not silently drop unallocated projects or unknown labels. Treat credits separately when an expired promotion makes one month appear more expensive despite unchanged infrastructure. Keep currencies in separate groups unless finance supplies an approved conversion basis.

GKE cost allocation can add workload-related dimensions to detailed billing export when configured. Check enablement and coverage before expecting historical namespace allocation. Retain shared and unallocated costs rather than spreading them across teams without an agreed allocation rule. The project/service query is a reconciliation starting point, not a namespace chargeback report.

GKE cost allocation.
03 · Analysis

Connect a cost line to workload constraints

For a fictional lab-api workload, collect resource requests, observed usage across demand cycles, pending pods, restarts, node pool capacity and service latency/error signals. An oversized request is a hypothesis to test; a quiet five-minute CPU graph does not establish safe headroom.

Separate Standard and Autopilot operating models and confirm the billing dimensions relevant to the actual cluster configuration. Review shared capacity, application dependencies, availability design and autoscaling behavior with the platform owner. Cost visibility does not give permission to resize a production workload.

04 · Analysis

Validate one change before buying commitments

Agree the change, test workload, acceptance thresholds and rollback trigger. Compare cost and reliability through a representative window that includes scale-out or node replacement where relevant. Use the checklist to keep the workload owner involved in acceptance.

Only model commitment coverage after usage changes have been evaluated. Record uncertainty when workload demand is unstable. This example has not been executed against a GCP account; validate SQL against the actual export schema and obtain technical review before treating it as an operating runbook.

Practical checkpoint

Before acting, confirm the owner, evidence, production risk, expected outcome, and validation method for each recommendation.

Related services and guidance

Continue researching

Related engineering guidance

Closely related analysis first, followed by adjacent cloud operating topics.

From analysis to implementation

Need senior engineers to apply this in production?

We can assess the current environment, validate the priority, and implement the approved work with clear scope, ownership, and outcome checks.