Export billing data to BigQuery
Tools for monitoring, analyzing and optimizing cost have become an important part of managing development. Billing export to Google BigQuery enables you to export your daily usage and cost estimates automatically throughout the day to a BigQuery dataset you specify. You can then access your billing data from BigQuery. You can also use this export method to export data to a JSON file.
Note: Regular file export to CSV and JSON is also available. However, if you use regular file export, you should be aware that regular file export captures a smaller dataset than export to BigQuery. For more information about regular file export and the data it captures, see Export billing data to a file and Contents of the exported billing file. For information about the data captured using export to BigQuery, see Billing data in BigQuery.
To enable billing export to BigQuery:
- Go to the Cloud Platform Console.
- Open the left side menu and select Billing
- If you have more than one billing account, select the name of the account you're interested in.
- Click Billing export.
- Select BigQuery export.
From the Project list, select the project where your BigQuery dataset is stored. If you don’t have a BigQuery dataset created yet, you’ll be prompted to create one.
If necessary, to create a new dataset:
- In the BigQuery web UI, click the down arrow icon next to your project name, then click Create new dataset.
- Specify the Dataset ID, Data location, and Data expiration for your dataset, then click OK.
- In the console, from the Billing export dataset list, specify a dataset to export data to. If you just created a dataset, choose the name of your new dataset.
- Click Enable BigQuery export.
After you enable BigQuery export, it might take a few hours to start seeing your data. Billing data automatically exports your data to BigQuery in regular intervals, but the frequency of updates in BigQuery varies depending on the services you're using.
Using Google BigQuery to store usage data will incur minimal fees. For more information, see Google BigQuery Pricing.
Note: This feature is in preview. The formatting and content of the dataset might change.