Google Cloud cost reporting needs the Detailed usage cost export of a Cloud Billing account, written to a BigQuery dataset in the EU multi-region. You set up the Google Cloud billing export for cost reporting once per billing account, not once per project. Costfluent reads it through a single grant, BigQuery Data Viewer on that dataset, with no service-account key. Timing matters most: Google backfills at most from the start of the previous month, and earlier months never appear later.
The problem: a project is not an invoice
A Cloud Billing account pays for every project linked to it, and Google invoices per billing account. Collecting cost project by project makes it easy to miss projects linked later and to end up with a total that does not match the invoice. The row-level basis for your own analysis is the BigQuery export, and it has one hard property: it exists only from the day you enable it. Turn it on when the board asks for a year-on-year comparison and that comparison does not exist.
Which exports Google offers
| Export | Table in the dataset | Contents | History |
|---|---|---|---|
| Standard usage cost | gcp_billing_export_v1_{billing_account_id} | Services, SKUs, projects, labels, locations, cost, usage, credits, adjustments, currency | EU or US multi-region: from the start of the previous month; single region: from enablement only |
| Detailed usage cost | gcp_billing_export_resource_v1_{billing_account_id} | Everything in standard plus resource fields such as resource.name and resource.global_name | As standard |
| Pricing | cloud_pricing_export | The billing account's prices by service, SKU and tier | From enablement only, never retroactive |
| FOCUS usage cost (Preview) | gcp_billing_export_focus_{billing_account_id} in a Google-provided dataset | Cost data in the FOCUS format, columns broadly mapping to the detailed export | Google deletes data after two years unless you copy it to a table you own |
For cost reports with resource detail, the detailed export is the right choice. Standard is enough for trends by service and project but has no individual resources. You only need the pricing export to compare list and effective prices yourself. If you also run AWS and are choosing between CUR 2.0 and FOCUS there, see AWS CUR 2.0 or FOCUS; FOCUS is defined in the glossary.
Set up the export: roles, dataset, location
- Choose a project. Google recommends a dedicated project for FinOps or billing data. Billing must be enabled on it and linked to the same billing account.
- Check roles. For standard and detailed export you need Billing Account Administrator (
roles/billing.admin) or Billing Account Costs Manager (roles/billing.costsManager) on the billing account, and BigQuery User on the project. The pricing export needs Billing Account Administrator, BigQuery Admin on the project and the BigQuery Data Transfer Service API enabled. - Create the dataset. Choose the EU multi-region. Google recommends a multi-region, and only multi-region datasets are backfilled. The location cannot be changed after creation. Costfluent requires the EU or US multi-region.
- Enable the export. In the console, go to Billing > Billing export > BigQuery export, edit the settings for Detailed usage cost, select the project and dataset, and save.
- Add GKE if you need it. To see GKE cost by cluster and namespace in Google's own export, enable GKE cost allocation per cluster:
gcloud container clusters update CLUSTER_NAME --enable-cost-allocation
Google allocates by resource requests, not by actual usage, does not backfill, and can take up to three days to show data. How that differs from distribution measured inside the cluster is covered in Kubernetes cluster cost.
How much history you actually get
- Google says the first cost data can take a few hours to appear, and up to five days to fully catch up with current usage.
- If you later change the project or dataset, earlier data stays in the old dataset. Google does not copy it; you join the two yourself.
- Do not insert your own rows into the export tables. Google warns the export process may delete them.
When you connect, Costfluent imports as far back as the history of your plan allows, at most six months, and only as far as the export holds data, whichever is shortest. Check the earliest usage_start_time in your table before the first month-on-month comparison.
A query sketch for the detailed export
This query lists the most expensive resources of a month by project and team label, with credits shown separately. Replace the project, dataset and table name with yours; the exact table name is visible in the dataset.
WITH line_items AS (
SELECT
project.id AS project_id,
resource.name AS resource_name,
(SELECT l.value FROM UNNEST(labels) AS l WHERE l.key = 'team') AS team,
currency,
cost,
IFNULL((SELECT SUM(c.amount) FROM UNNEST(credits) AS c), 0) AS credit
FROM `billing-project.billing_export.gcp_billing_export_resource_v1_{billing_account_id}`
WHERE usage_start_time >= TIMESTAMP('2026-09-01')
AND usage_start_time < TIMESTAMP('2026-10-01')
)
SELECT
project_id, resource_name, team, currency,
SUM(cost) AS cost,
SUM(credit) AS credits,
SUM(cost) + SUM(credit) AS cost_after_credits
FROM line_items
GROUP BY project_id, resource_name, team, currency
ORDER BY cost_after_credits DESC
LIMIT 25;
How to read the result:
costincludes negotiated discounts but not credits. Credits are negative amounts in thecreditsfield; only the sum of both gives cost after credits.currencyis the billing account's currency.currency_conversion_rateis the rate from US dollars to that currency.usage_start_timeis when usage happened,invoice.monththe invoice it lands on. Usage can appear on a later invoice. Filter oninvoice.monthto match the invoice and on usage time for engineering analysis.resource.nameis null where a line has no resource. Google lists services, such as Cloud Storage and Cloud SQL, that provide onlyresource.global_name.cost_typeseparates regular cost, tax, adjustments and rounding errors.
Google warns that grouping by several labels through UNNEST(labels) and adding the results double counts cost. The subquery above therefore reads exactly one label per row. Google also notes that querying the detailed export can cost more than querying standard, so select only the columns you need, and recommends querying through views because the schema can change.
Common mistakes
- Dataset created in a single region. No backfill, and Costfluent requires the EU or US multi-region. The location cannot change, so the fix is a new dataset with a new export start.
- Only the standard export enabled. Resource fields are missing. Enable the detailed export as well; it starts its own history.
- The grant fails on an organisation policy. Domain restricted sharing (
iam.allowedPolicyMemberDomainsoriam.managed.allowedPolicyMembers) admits only allowed identities. Allow the organisation ID and customer ID Costfluent shows beside the service-account email first. - Invoice month and usage month mixed up. Late usage moves amounts between months. The article on month-end covers how to treat that at close.
What the Costfluent connection does
Costfluent creates a service account for your organisation in its own Google Cloud project. You grant that account BigQuery Data Viewer on the export dataset and nothing else. No key is created or exchanged, in line with Google's advice to avoid service-account keys where possible. Queries run in Costfluent's project and are paid for there. The account cannot see other datasets, run jobs on your bill or change anything.
Under Settings > Integrations > Google Cloud Platform, Add billing account shows the service-account email. You enter the billing account ID, project and dataset, then test the connection. Costfluent validates the query it will run before storing anything; if the grant is missing, or Google has not written a table yet, the test says so. Afterwards the connection shows whether the dataset is still readable, which workspaces it feeds and which billing months are imported, and Run checks repeats each check separately. A Terraform module (costfluent/cost-access/gcp) makes the same grant in code.
The connection is available on every plan, Free included, and no plan limits connections. Details are on the Google Cloud integration page. The steps are in the docs under connecting Google Cloud. Removing the connection erases the cost it imported; remove the dataset grant as well.
Next step
Record five facts in your cost documentation: billing account ID, project and dataset, dataset location, first day in the export, and the grant. Every cost report can then be traced through the monthly cloud cost review back to the invoice. If the export is not running yet, enable it now even if analysis comes later: Google never backfills anything older than the month before enablement.
Sources and method
Checked on 2026-10-10. Google Cloud, Export Cloud Billing data to BigQuery, Set up export (roles, location, data availability), auto-created tables, detailed export schema, example queries, Cloud Billing roles, GKE cost allocation, domain restricted sharing and managing service-account keys. Statements about the Costfluent connection follow the Google Cloud integration page and the product documentation, Connect GCP. The query is a Costfluent sketch; check table names and schema against your own dataset.



