Understand the Cloud Billing data tables in BigQuery

This page provides reference information for the schema of the Cloud Billing data that is exported to each table in BigQuery.

Billing data tables

Shortly after enabling Cloud Billing export to BigQuery, billing data tables are automatically created in the BigQuery dataset.

  • Standard usage cost table – In your BigQuery dataset, this table is named gcp_billing_export_v1_<BILLING_ACCOUNT_ID>.
  • Detailed usage cost table – This includes all of the data fields from the standard usage cost table, along with additional fields that provide resource-level cost data, such as a virtual machine or SSD that generates service usage. In your BigQuery dataset, this table is named gcp_billing_export_resource_v1_<BILLING_ACCOUNT_ID>.
  • Pricing data table – In your BigQuery dataset, this table is named cloud_pricing_export.

Frequency of data loads

Standard and detailed usage cost export:

  • When you first enable the standard or detailed usage cost export to BigQuery, it might take a few hours to start seeing Google Cloud cost data propagate to your BigQuery dataset. Data is exported in chronological order. If your export is configured to include data retroactively for the current and previous month, it might take up to 5 days for the exported data to fully catch up to your current usage data.
  • Google Cloud services report usage and cost data to Cloud Billing processes at varying intervals.
  • Cloud Billing exports usage and cost data to your BigQuery dataset at regular intervals (there are no delivery or latency guarantees for the export to BigQuery).
  • Because the usage reporting frequency varies by Google Cloud service, you might not see Cloud Billing usage and cost data right away for all recently used Google Cloud services.

Pricing export:

  • When you first enable the pricing export to BigQuery, it might take up to 48 hours to start seeing your Google Cloud pricing data.
  • After you enable pricing export, the pricing data applicable to your Cloud Billing account is exported to BigQuery once each day.

Data availability:

  • For customers who enable the standard usage cost or detailed usage cost data export for the first time:

    • If you configure your BigQuery dataset to use a multi-region location (EU or US), Cloud Billing data is exported retroactively from the start of the previous month. For example, if you enable standard usage cost or detailed usage cost data export on September 23rd, your export will include data beginning August 1st.

      We export data in chronological order, one day at a time, so the data from the first day of the last month is populated first. For the initial backfill of exported data, it might take up to 5 days for your retroactive Cloud Billing data to finish exporting before you start seeing your most recent usage data.

    • If you configure your BigQuery dataset to use a supported region location, your standard usage cost or detailed usage cost data is available from the date you enable Cloud Billing export, and after. That is, Google Cloud billing data is NOT added retroactively for non-multi-region dataset locations, so you won't see Cloud Billing data from before you enable export.

    • For customers who have enabled, disabled, and subsequently re-enabled the standard usage cost or detailed usage cost data export, the Cloud Billing data might not be available for the period when export was explicitly disabled.

  • If you enable the pricing data export, your BigQuery dataset only reflects Cloud Billing data incurred from the date when you first enabled the pricing export, and after. Cloud Billing pricing data is not added retroactively, so you won't see pricing data for dates that occurred before you enabled export.

  • The data in the BigQuery datasets reflects the state of your resources at the time that the usage was recorded. If you make changes to your resources, such as adding new labels to a project, or changing a project's hierarchy (which would change project.ancestors), those changes are only shown in future exports of usage data. Previously exported records are not changed.

  • If you delete any exported data (such as BigQuery export records), we cannot backfill the deleted records.

  • BigQuery loads are ACID compliant, so if you query the BigQuery Cloud Billing export dataset while data is being loaded into it, you will not encounter partially loaded data.

  • See other limitations that might impact exporting your billing data to BigQuery, such as datasets with customer-managed encryption keys (CMEK) enabled.

Limitations

Exporting Cloud Billing data to BigQuery is subject to the following limitations.

  • BigQuery dataset locations supported for use with Cloud Billing data

    BigQuery datasets are configured to use a location – either a multi-region location (EU or US), or a region location. The dataset location is set at creation time. After a dataset is created, its location cannot be changed.

    Cloud Billing data export supports all multi-region locations (EU or US), but only a subset of region locations. When you are configuring your Cloud Billing export settings, if you create or select a dataset that is configured to use an unsupported region location, when you attempt to save your export settings, you will see an Invalid dataset region error.

    The following table lists the multi-region locations and the region locations that are supported for use with BigQuery datasets that are used to contain Cloud Billing data.

    Americas Asia Pacific Europe

    Multi-region: US

    Regions:

    • northamerica-northeast1 (Montréal)
    • southamerica-east1 (São Paulo)
    • us-central1 (Iowa)
    • us-east1 (South Carolina)
    • us-east4 (Northern Virginia)
    • us-west1 (Oregon)
    • us-west2 (Los Angeles)
    • us-west3 (Salt Lake City)
    • us-west4 (Las Vegas)

    Regions:

    • asia-east1 (Taiwan)
    • asia-east2 (Hong Kong)
    • asia-northeast1 (Tokyo)
    • asia-northeast2 (Osaka)
    • asia-northeast3 (Seoul)
    • asia-south1 (Mumbai)
    • asia-southeast1 (Singapore)
    • asia-southeast2 (Jakarta)
    • australia-southeast1 (Sydney)

    Multi-region: EU

    Regions:

    • europe-central2 (Warsaw)
    • europe-north1 (Finland)
    • europe-west1 (Belgium)
    • europe-west2 (London)
    • europe-west3 (Frankfurt)
    • europe-west4 (Netherlands)
    • europe-west6 (Zurich)

  • For your BigQuery datasets containing standard usage cost data or detailed usage cost data, the type of location you configure on the dataset impacts the timing of when your Google Cloud billing data is exported to the dataset:

    • If you configure the dataset to use a multi-region location (EU or US), the dataset includes Google Cloud billing data incurred from the start of the previous month from when you first enabled the export, unless you are re-enabling the export. That is, Google Cloud billing data is added retroactively for the current and previous month. For the initial backfill of exported data, it might take up to 5 days for your retroactive Cloud Billing data to finish exporting before you start seeing your current usage data.
    • If your dataset is configured to use a supported region location, your standard usage cost data and your detailed usage cost data only reflect Google Cloud billing data incurred starting from the date you enabled Cloud Billing export, and after. That is, Google Cloud billing data is not added retroactively for non-multi-region dataset locations, so you won't see Cloud Billing data from before you enable export.

    • For more details, see Data availability.

  • Your BigQuery datasets containing pricing data only collect Google Cloud billing data incurred from the date you set up Cloud Billing export, and after. That is, Google Cloud pricing data is not added retroactively, so you won't see Cloud Billing pricing data from before you enable export. For more details, see Data availability.

  • When exporting detailed usage cost data, the detailed export automatically includes resource-level information about Compute Engine. To view a breakdown of Google Kubernetes Engine (GKE) cluster costs in a detailed data export, you must also enable cost allocation for GKE.

  • Dataset encryption: Customer-managed encryption keys (CMEK) are not supported when exporting billing data to BigQuery. If you enable CMEK encryption for your billing data dataset, this type of encryption prevents Cloud Billing from writing billing data to the appropriate tables within that dataset. Instead, you need to enable the dataset to use a Google-managed encryption key.

  • If you want to use BigQuery row-level security on the table that contains your exported data, you must give the Cloud Billing export service account billing-export-bigquery@system.gserviceaccount.com full access to the table using the BigQuery TRUE filter. The following command grants access to the Cloud Billing service account:

    CREATE ROW ACCESS POLICY cloud_billing_export_policy
    ON `__project_id__.__dataset_id__.__table_id__`
    GRANT TO ('serviceAccount:billing-export-bigquery@system.gserviceaccount.com')
    FILTER USING (TRUE);
    
  • Resource-level Tags might take up to an hour to propagate to BigQuery exports. If a tag has been added or removed within an hour, or if a resource has existed for less than an hour, it might not appear in the export.

    Resource-level tags are available for the following resources:

    • Compute Engine instances
    • Spanner instances
    • Cloud Run services
    • Artifact Registry repositories
  • If you use VPC Service Controls, your BigQuery exports might be blocked. To resolve, you need to manually exempt VPC.

Cost and pricing reports available in the Google Cloud console