Enable Detailed Billing Export
Follow the official GCP documentation to set up the detailed usage cost export to BigQuery:Export Cloud Billing data to BigQuery
Google Cloud guide covering dataset creation, enabling the export, and GKE cost allocation.
- Select the Detailed usage cost export type (not standard)
- Use a BigQuery dataset with Google-managed encryption (CMEK is not supported)
- Use a multi-region dataset (US or EU) if you want retroactive backfill of up to five days
If you use Google Kubernetes Engine, you must also enable GKE cost allocation separately to get cost breakdowns by namespace, cluster, and workload.
Verify the Export
After a few hours, verify that data is flowing into BigQuery:- Open the BigQuery console.
- Navigate to your dataset.
- Look for a table named
gcp_billing_export_resource_v1_<BILLING_ACCOUNT_ID>. - Run a sample query to confirm data is present:
project_id.dataset_id and the table name suffix with your actual values.
Important Considerations
- Data latency: Billing data typically appears in BigQuery within a few hours, but it can take up to 24 hours.
- Retroactive backfill: When first enabled with a multi-region dataset, GCP backfills up to five days of historical data.
- Dataset changes: If you change the destination dataset, previously exported data is not automatically migrated to the new dataset.