Committed use discounts
Google Cloud publishes the lifecycle of your committed use discounts in a separate BigQuery export. Enabling it fills in the commitment term, start and end dates, and status on your Google Cloud commitments.
Skip this page if you hold no committed use discounts. Everything else about commitments, including coverage and utilization, already works from the Detailed usage cost export.
This export only works with an organization connection. If any of your Google Cloud connections is a single project, LevelFour keeps commitment lifecycle data off, because the export covers the whole billing account and cannot be narrowed to one project. Connect at the organization level first. See Connect Google Cloud.
Google lists this export as Preview. Its fields can change, and the data you see may lag or shift as Google finishes the feature.
What you get
| Field | Source |
|---|---|
| Commitment term (1 year, 3 year) | This export |
| Start and end dates | This export |
| Commitment status | This export |
| Coverage and utilization | Detailed usage cost export, already working |
| Spend against the commitment | Detailed usage cost export, already working |
Prerequisites
- An organization connection to LevelFour, with no single-project connections alongside it.
- The Detailed usage cost export already connected.
- Billing Account Administrator or Costs Manager on the Cloud Billing account.
- BigQuery Admin on the project that holds your billing export dataset.
Step 1 - Turn on the export
- Open the Cloud Billing console and select your billing account.
- Go to Billing export, then the BigQuery export tab.
- Under Committed use discounts, click Edit settings and choose the project that already holds your billing export dataset.
Choose the same project as your Detailed usage cost export. LevelFour looks for this export inside that project only.
Google delivers this export differently from the usage cost exports. Rather than adding a table to your existing dataset, it creates a linked dataset in your project through Analytics Hub, alongside your billing export dataset. A common result is a billing_export_cud dataset sitting next to billing_export.
You do not report the dataset name to LevelFour. LevelFour finds it by looking for the export table inside your billing project.
Step 2 - Grant LevelFour read access
The connect commands do not cover this dataset, because it did not exist when you ran them. Grant access yourself. It takes two grants: one so LevelFour can find the dataset, one so it can read it.
Use the address the connect script printed; see Finding your service-account address if you no longer have it. Run bq ls --datasets YOUR_EXPORT_PROJECT_ID if you are not sure what Google named the linked dataset.
Let LevelFour find the dataset. From Cloud Shell:
SA="PASTE_THE_ADDRESS_THE_SCRIPT_PRINTED"
gcloud projects add-iam-policy-binding YOUR_EXPORT_PROJECT_ID \
--member="serviceAccount:$SA" --role="roles/bigquery.metadataViewer"Let LevelFour read the dataset. In the Google Cloud console, open BigQuery, find the linked dataset, then Sharing -> Permissions -> Add principal. Paste the service-account address and assign BigQuery Data Viewer.
To do the same from Cloud Shell, edit the dataset's access list in place:
bq show --format=prettyjson YOUR_EXPORT_PROJECT_ID:billing_export_cud > cud-access.json
# add {"role": "READER", "userByEmail": "<the service-account address>"} to the "access" array
bq update --source cud-access.json YOUR_EXPORT_PROJECT_ID:billing_export_cudStep 3 - Wait for the first snapshot
Google writes this export as a daily snapshot. Allow up to 48 hours after enabling it, plus up to a day for LevelFour's next read.
Confirming it worked
Open Connect Accounts -> Google Cloud in the dashboard. The Committed Use Discounts (BigQuery export) panel moves to Connected and shows when it last synced. Your commitments then carry a term, start and end dates, and a status.
The panel reaches Connected only when all of the following hold:
- Every Google Cloud connection in your account is an organization connection.
- Your Detailed usage cost export is connected and has delivered data.
- The linked dataset exists in the same project as your billing export.
- LevelFour can list datasets in that project and read the linked dataset.
See the export status reference for what each label means.
Removing access
Remove the LevelFour principal from the linked dataset's permissions in the BigQuery console, then drop the project-level role:
SA="PASTE_THE_ADDRESS_THE_SCRIPT_PRINTED"
gcloud projects remove-iam-policy-binding YOUR_EXPORT_PROJECT_ID \
--member="serviceAccount:$SA" --role="roles/bigquery.metadataViewer"Disabling the export in the Cloud Billing console stops new snapshots. Your commitments keep their coverage and utilization figures, which come from the usage cost export.
Troubleshooting
The panel stays at Not connected yet.
Most often the linked dataset landed in a different project than your billing export, or the grants in Step 2 were never applied. Confirm with bq ls --datasets YOUR_EXPORT_PROJECT_ID that the dataset is in the expected project.
The panel stays at Not connected yet and you connected a single project. Commitment lifecycle data needs an organization connection. Reconnect at the organization level.
The panel shows Sync error. The panel shows the reason Google Cloud returned. A permission error means the grants in Step 2 are missing or have not propagated yet; wait a few minutes and check again.
Commitments show coverage but no term or dates. Expected before this export lands. Coverage comes from the usage cost export and works on its own.
Billing export
Turn on the Detailed usage cost export in Cloud Billing so LevelFour can analyze granular, resource-level Google Cloud cost data.
GitHub
Install LevelFour as a GitHub App on your organization so we can read your Infrastructure-as-Code (Terraform, CloudFormation, AWS CDK, Pulumi, and Kubernetes manifests), open savings pull requests, and comment cost impact on the PRs your team opens.