Compute Engine usage report deprecation

The usage export in Compute Engine was deprecated on January 20, 2026 and will be discontinued on March 30, 2026. To export Compute Engine usage, use BigQuery Exports .

Generate usage reports with BigQuery

This section summarizes how to export Compute Engine usage reports to BigQuery. For more information, see Export Cloud Billing data to BigQuery .

To retrieve usage data with BigQuery, follow these steps:

  1. Set up Cloud Billing data export to BigQuery . This creates a dataset that you can query for usage information.
  2. Retrieve usage data with SQL queries. The following section describes how to run a query and provides some sample queries.

Retrieve usage reports with SQL queries

Use the following SQL queries to retrieve usage reports. The query can be run in BigQuery following the instructions in Run interactive queries .

Replace the following variables:

  • PROJECT_ID : The ID of the project that contains your BigQuery dataset.
  • DATASET_NAME : The name of the BigQuery dataset that contains your billing data.
  • BILLING_ACCOUNT_ID : Your Cloud Billing account ID, with hyphens (-) replaced by underscores (_). For example, 012345_567890_ABCDEF .
  • PROJECT_NUMBER : Your project number.
  • DAY : The day of month to report on, in format DD .
  • MONTH : The month to report on, in format MM .
  • YEAR : The year to report on, in format YYYY .

Use the following query to produce daily usage data:

  SELECT 
  
 DATE 
 ( 
 usage_end_time 
 ) 
  
 as 
  
 report_date 
 , 
  
 sku 
 . 
 id 
  
 as 
  
 measurement_id 
 , 
  
 sum 
 ( 
 usage 
 . 
 amount 
 ) 
  
 as 
  
 quantity 
 , 
  
 usage 
 . 
 unit 
  
 as 
  
 unit 
 , 
  
 REPLACE 
 ( 
 REPLACE 
 ( 
 REPLACE 
 ( 
 resource 
 . 
 global_name 
 , 
  
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )))], 
  
 SPLIT 
 ( 
 resource 
 . 
 name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 name 
 , 
  
 "/" 
 )))]), 
  
 "//compute.googleapis.com/" 
 , 
  
 "https://www.googleapis.com/compute/v1/" 
 ), 
  
 "/projects/ PROJECT_NUMBER 
/" 
 , 
 "/projects/ PROJECT_ID 
/" 
 ) 
  
 as 
  
 resource_uri 
 , 
  
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )))] 
  
 as 
  
 resource_id 
 , 
  
 location 
 . 
 region 
  
 as 
  
 location 
 , 
 FROM 
  
 ` 
  PROJECT_ID 
 
 . 
  DATASET_NAME 
 
 . 
 gcp_billing_export_resource_v1_ BILLING_ACCOUNT_ID 
 
 ` 
 WHERE 
  
 TRUE 
  
 AND 
  
 EXTRACT 
 ( 
 DAY 
  
 FROM 
  
 usage_end_time 
 ) 
  
 = 
  
  DAY 
 
  
 AND 
  
 EXTRACT 
 ( 
 MONTH 
  
 FROM 
  
 usage_end_time 
 ) 
  
 = 
  
  MONTH 
 
  
 AND 
  
 EXTRACT 
 ( 
 YEAR 
  
 FROM 
  
 usage_end_time 
 ) 
  
 = 
  
  YEAR 
 
  
 AND 
  
 service 
 . 
 id 
  
 = 
  
 "6F81-5844-456A" 
 GROUP 
  
 BY 
  
 1 
 , 
 2 
 , 
 4 
 , 
 5 
 , 
 6 
 , 
 7 
 

Use the following query to produce monthly usage data:

  SELECT 
  
 DATE 
 ( 
 usage_end_time 
 ) 
  
 as 
  
 report_date 
 , 
  
 sku 
 . 
 id 
  
 as 
  
 measurement_id 
 , 
  
 sum 
 ( 
 usage 
 . 
 amount 
 ) 
  
 as 
  
 quantity 
 , 
  
 usage 
 . 
 unit 
  
 as 
  
 unit 
 , 
  
 REPLACE 
 ( 
 REPLACE 
 ( 
 REPLACE 
 ( 
 resource 
 . 
 global_name 
 , 
  
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )))], 
  
 SPLIT 
 ( 
 resource 
 . 
 name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 name 
 , 
  
 "/" 
 )))]), 
  
 "//compute.googleapis.com/" 
 , 
  
 "https://www.googleapis.com/compute/v1/" 
 ), 
  
 "/projects/ PROJECT_NUMBER 
/" 
 , 
 "/projects/ PROJECT_ID 
/" 
 ) 
  
 as 
  
 resource_uri 
 , 
  
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )[ 
 ORDINAL 
 ( 
 ARRAY_LENGTH 
 ( 
 SPLIT 
 ( 
 resource 
 . 
 global_name 
 , 
  
 "/" 
 )))] 
  
 as 
  
 resource_id 
 , 
  
 location 
 . 
 region 
  
 as 
  
 location 
 , 
 FROM 
  
 ` 
  PROJECT_ID 
 
 . 
  DATASET_NAME 
 
 . 
 gcp_billing_export_resource_v1_ BILLING_ACCOUNT_ID 
 
 ` 
 WHERE 
  
 TRUE 
  
 AND 
  
 EXTRACT 
 ( 
 MONTH 
  
 FROM 
  
 usage_end_time 
 ) 
  
 = 
  
  MONTH 
 
  
 AND 
  
 EXTRACT 
 ( 
 YEAR 
  
 FROM 
  
 usage_end_time 
 ) 
  
 = 
  
  YEAR 
 
  
 AND 
  
 service 
 . 
 id 
  
 = 
  
 "6F81-5844-456A" 
 GROUP 
  
 BY 
  
 1 
 , 
 2 
 , 
 4 
 , 
 5 
 , 
 6 
 , 
 7 
 

Shutdown schedule

The following table lists the shutdown schedule for Compute Engine export.

Date Event
January 20, 2026 Compute Engine usage export is deprecated.
March 30, 2026 Compute Engine usage reports will no longer be exported.
Create a Mobile Website
View Site in Mobile | Classic
Share by: