Google Cloud currently allow you to programmatically inspect your costs by exporting your project’s billing information to a dedicated dataset configured in your project’s BigQuery database.Documentation Index
Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
Use this file to discover all available pages before exploring further.
Create a new dataset on BigQuery
Follow these steps provided by GCP official documentation to create a new dataset.Export Billing Data into BigQuery
Follow these steps provided by GCP official documentation to export your billing information into an existing dataset in your BigQuery database. The exported billing information covers all your GCP projects that are under the same GCP billing account. After the export has been configured, GCP will automatically create a new table in the provided dataset. The new table name should be likegcp_billing_export_v1_011D4F_BEC512_83EA95 (for e.g).
Create GCP Service Account key
Follow these steps provided by GCP official documentation to export new keys for your service account. This service account should have the following permissions:bigquery.jobs.createbigquery.tables.getData
BigQuery Job UserBigQuery Data Viewer
Add Credentials to your Organization
- Under your Organization Settings, Select the Credentials tab
- Click Add Credential
- Select the
GCP Credentialstype. - Enter the BigQuery Table ID that you’ve created in the previous step.
Table ID should look like<PROJECT_ID>.<DATASET_NAME>.<TABLE_NAME>where:
PROJECT_ID- the GCP project name.DATASET_NAME- the dataset name that you’ve created in the previous step.TABLE_NAME- the table name that you’ve created in the previous step.
- Enter the
Service Account Key JSONthat you’ve created and downloaded in the previous step. - Click Add
Enable cost monitoring
- Go to the Project Settings of the desired project.
- Select the Credentials tab.
- Check the appropriate cloud provider checkbox, and select the credential you created in the steps above.
- Click Save.
Next steps
- Set Cost Monitoring - Enable cost tracking after adding credentials.
- Set Budget Notifications - Alert your team when spending crosses a threshold.
- Cloud Analyst - Explore AI-powered cost insights across your organization.