
Key takeaways
- Export detailed billing to BigQuery and label every project and resource.
- Five SQL queries on the export show cost by service, team, SKU and day.
- Use the Recommender for idle VMs, disks, IPs and rightsizing.
- Spot VMs, schedules and the right machine family cut compute costs.
- Partitioning, clustering and query quotas keep BigQuery under control.
- Committed use discounts come last, for the proven baseline.
How do you see where Google Cloud money goes?
- Export billing to BigQuery. Turn on the detailed (resource-level) Cloud Billing export. It is the foundation for every report and allocation.
- Label resources and projects. Use a small, enforced set of labels (team, product, environment), and use the project hierarchy to separate owners.
- Set budgets and alerts. Budgets per project or label, with alerts to the owning team, not only to finance.
- Read the Recommender. Google's Recommender and the Active Assist hub list idle VMs, idle disks, unused IP addresses and rightsizing suggestions.
How do you query the billing export in BigQuery?
Once the export is on, every line of your bill lands in a BigQuery table named like gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX (the standard export) or gcp_billing_export_resource_v1_… (the detailed, resource-level export). Each row is one SKU for one project over a short usage window. The columns you will use most are:
service.descriptionandsku.description: what you paid for.project.id,labelsandproject.labels: who it belongs to.cost: the cost before credits, andcredits: an array of discounts, such as sustained use and committed use credits, as negative amounts.usage_start_timeandinvoice.month: when it was used and which invoice it lands on.
Replace the table name in the queries below with your own. Each query filters on a date or invoice month, which keeps the amount of data scanned, and therefore the query cost, small.
1. Net cost by service for the last 30 days
SELECT
service.description AS service,
ROUND(SUM(cost), 2) AS gross_cost,
ROUND(SUM(IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) AS c), 0)), 2) AS credits,
ROUND(SUM(cost) + SUM(IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) AS c), 0)), 2) AS net_cost
FROM `my-project.billing.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE usage_start_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
GROUP BY service
ORDER BY net_cost DESC;
Start every review here. The top five services usually account for most of the bill, so that is where to look first.
2. Cost by team label, for one invoice month
SELECT
IFNULL((SELECT value FROM UNNEST(labels) WHERE key = 'team'), '(no team label)') AS team,
ROUND(SUM(cost), 2) AS cost
FROM `my-project.billing.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE invoice.month = '202611'
GROUP BY team
ORDER BY cost DESC;
The “(no team label)” row is your allocation gap. If it is more than a small share of the bill, fixing labels comes before any optimization work, because nobody owns that spend.
3. The 20 most expensive SKUs
SELECT
service.description AS service,
sku.description AS sku,
ROUND(SUM(cost), 2) AS cost
FROM `my-project.billing.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE invoice.month = '202611'
GROUP BY service, sku
ORDER BY cost DESC
LIMIT 20;
SKU-level detail shows what service totals hide: a premium disk type, cross-region egress or an old machine family that costs more than its newer replacement.
4. Daily spend, to spot anomalies
SELECT
DATE(usage_start_time) AS day,
ROUND(SUM(cost), 2) AS cost
FROM `my-project.billing.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE usage_start_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 60 DAY)
GROUP BY day
ORDER BY day;
Chart this in Looker Studio or your BI tool. A step change that does not match a release or a traffic event is worth investigating the same week, not at month-end.
5. Share of spend with no labels
SELECT
ROUND(100 * SUM(IF(ARRAY_LENGTH(labels) = 0, cost, 0)) / SUM(cost), 1) AS pct_unlabeled
FROM `my-project.billing.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX`
WHERE invoice.month = '202611';
Track this number monthly. It is the simplest measure of whether your labeling policy is working.
How do you cut Compute Engine costs?
- Remove idle VMs and disks. Stopped VMs still pay for their persistent disks and reserved static IPs.
- Rightsize with custom machine types. Compute Engine lets you choose vCPU and memory separately, so you can match real usage instead of the nearest predefined shape.
- Use the right machine family. E2 for general-purpose cost efficiency, newer general-purpose and compute-optimized families for performance per dollar, and Arm-based options where your software supports them. Benchmark before switching.
- Use Spot VMs for interruptible work. Google quotes discounts of 60–91% versus on-demand prices for batch jobs, CI and fault-tolerant workers.
- Schedule non-production VMs. Instance schedules start and stop development VMs on a timetable.
- Choose the right disk type. Balanced persistent disks suit most workloads; reserve SSD and extreme options for databases that need them.
Which Google Cloud discounts should you use?
| Discount | How it works | Best for |
|---|---|---|
| Sustained use discounts | Applied automatically to eligible machine families that run for a large part of the month | Steady VMs on eligible families, with no commitment |
| Resource-based committed use discounts | Commit to a quantity of vCPU, memory, GPUs or local SSD in a region for 1 or 3 years | Predictable, long-running Compute Engine capacity |
| Spend-based (flexible) committed use discounts | Commit to an hourly spend that applies across eligible services and machine families | Steady spend that moves between machine types or services |
| Spot VMs | Deep discounts in exchange for possible preemption | Batch, CI and stateless workloads |
As with any commitment, remove waste and rightsize first, then commit only to the baseline you are confident will run for the full term.
How do you cut GKE costs?
- Enable GKE cost allocation to see cost by namespace and label.
- Set realistic CPU and memory requests; over-requested pods waste node capacity even when they are idle.
- Use the cluster autoscaler and node auto-provisioning, or Autopilot, where you pay for pod requests rather than whole nodes.
- Run fault-tolerant workloads on Spot node pools.
How do you cut BigQuery costs?
- Partition and cluster tables so queries scan only the data they need, and require a partition filter on large tables.
- Avoid
SELECT *; on-demand pricing charges by bytes scanned, so select only the columns you use. - Compare on-demand with capacity (editions) pricing once spend is steady, and set per-user and per-project query quotas.
- Check storage billing. Long-term storage (tables unchanged for 90 days) is cheaper automatically; compare logical with physical storage billing for compressible data.
How do you cut storage, logging and network costs?
- Cloud Storage: use lifecycle rules or Autoclass to move objects to Nearline, Coldline or Archive, and delete what you no longer need.
- Cloud Logging: add exclusion filters for noisy, low-value logs and set retention on log buckets.
- Network: keep services that talk a lot in the same region, use Cloud CDN for static content, and watch Cloud NAT and internet egress charges.
- Cloud SQL: rightsize instances and stop non-production instances outside working hours.
How do you size committed use discounts safely?
Commit only to what you are confident will run for the whole term. A practical method:
- Finish rightsizing first, so you do not commit to capacity you are about to remove.
- Look at hourly vCPU and memory usage per region and machine family over the last 60 to 90 days.
- Take a conservative baseline, such as the level usage rarely drops below, rather than the average.
- Cover that baseline with resource-based commitments where the machine family is stable, and use spend-based (flexible) commitments where workloads move between families or services.
- Review coverage and utilization monthly, and add commitments in small steps as the baseline grows.
Under-committing costs you some discount. Over-committing costs you money every hour for one or three years, so err on the low side.
How do you cut Cloud Run and serverless costs?
- Check minimum instances. Minimum instances keep containers warm and remove cold starts, but they bill while idle. Use them only on latency-sensitive services.
- Choose how CPU is billed. Request-based billing charges only while a request is handled; instance-based billing suits services with background work. Pick per service, not by default.
- Raise concurrency where your code allows it, so each instance serves more requests at once.
- Right-size memory and CPU per service using real usage, as you would for a VM.
- Watch Cloud Functions and Pub/Sub retries. Failing messages that retry endlessly are a common source of silent spend.
How do you control GPU and AI costs on Google Cloud?
AI workloads are now the fastest-growing line on many Google Cloud bills, and they behave differently from ordinary compute:
- Separate training from serving. Training jobs are bursty and often interruptible, so they suit Spot capacity and scheduled runs. Serving needs steady capacity and is the place for commitments.
- Watch idle accelerators. A GPU VM or notebook left running over a weekend can cost more than a month of ordinary VMs. Set idle shutdown on Vertex AI Workbench instances and schedules on GPU VMs.
- Match the accelerator to the job. The newest, largest GPU is rarely the cheapest per result. Benchmark cost per training run or per thousand predictions, not cost per hour.
- Track model API spend separately. Calls to hosted models are billed per token or per request. Label projects by feature so the billing export shows which product feature drives the cost, and see our guide to tracking and cutting LLM costs.
- Set budgets on AI projects first. Experiments grow quickly; a budget alert at 50% and 90% of the monthly plan catches runaway jobs early.
What should a monthly Google Cloud cost report show?
A good monthly report fits on one page and answers four questions for engineering and finance together:
- What did we spend, and why did it change? Net cost by service and by team, compared with last month, with a one-line reason for every large movement.
- Who owns it? The share of spend with no team label, and the plan to reduce it.
- What did we save? Savings from rightsizing, deletions and commitments, measured on the bill rather than estimated.
- What is next? The top three open recommendations, each with an owner, an expected saving and a date.
Add one unit-cost measure, such as cost per customer or per thousand requests, so the conversation is about efficiency as the business grows, not only about the total.
How do you keep costs down once they are fixed?
Most savings drift back within months unless someone owns them. Three habits keep them in place:
- A monthly cost review with engineering and finance, using the queries above, the Recommender and your budget alerts.
- Guardrails through organization policies, for example limiting which regions resources can be created in, so expensive mistakes are prevented rather than found later.
- Unit economics: cost per customer, per transaction or per thousand requests, so growth in spend is judged against growth in the business.
If you run more than one cloud, export billing in the FOCUS format from each provider so Google Cloud, AWS and Azure costs sit in one report. See our Azure cost optimization playbook and 25 ways to reduce your AWS bill.
What does a 30-day Google Cloud cost plan look like?
| Week | Focus |
|---|---|
| 1 | Billing export to BigQuery, labels, budgets and alerts |
| 2 | Idle VMs, disks and IPs; schedules for non-production |
| 3 | Rightsizing, machine families, GKE requests, BigQuery partitioning |
| 4 | Committed use discounts for the proven baseline; monthly review cadence |
Discount levels and features change; check the Google Cloud pricing pages and documentation before committing.
Frequently asked questions
What is the difference between sustained use and committed use discounts?
Sustained use discounts apply automatically to eligible VMs that run much of the month. Committed use discounts require a 1- or 3-year commitment and give larger discounts.
Is BigQuery on-demand or capacity pricing cheaper?
It depends on how steady your query volume is. Compare the two using your own billing export before switching.
Does GKE Autopilot save money?
Often, for clusters with poor bin-packing, because you pay for pod requests rather than whole nodes. Busy, well-packed clusters may be cheaper on Standard.
Can CloudLens analyze Google Cloud?
Yes. CloudLens supports Google Cloud, AWS and Azure with read-only access. See CloudLens.
More questions? See all FAQs →
