In addition to the Billing product available within the GCP Console, you may want to export billing data to BigQuery for custom analytics. Below are some example queries to help get you started using the standard data export format. See the links below to learn more about GCP billing datasets including how to export your own billing data for analysis.
The example SQL snippets below reference a sample billing export available as a public dataset in BigQuery (bqutil.billing.billing_dashboard_export
). You will need to replace references to this table with your own project and dataset.
Description | Time Period | Additional Dimensions | SQL | Additional Docs |
---|---|---|---|---|
Monthly total costs and credits | monthly | - | Link | - |
Monthly invoice total costs and credits | monthly | - | Link | - |
Monthly total costs by project | monthly | project | Link | - |
Previous month's net-charges per service | monthly | service | Link | - |
Previous month’s net-charges by resource label | monthly | label | Link | - |
Previous month’s per-service charges by label value | monthly | service,label | Link | - |
Monthly CUD/SUD savings | monthly | - | Link | Link |
Daily compute usage CUD/SUD coverage | daily | region, unit, project, sku | Link | Link |
Previous day's spend per project | daily | project | Link | - |
Previous day's spend per GCP Service | daily | service | Link | - |
Daily compute usage hours | daily | sku, component | Link | - |
Daily compute cost including discount | daily | - | Link | - |
Daily average number of cores executed | daily | - | Link | - |
Total costs by label value | total | label | Link | - |
Total costs by SKU and labels | total | sku, label | Link | - |