Connect GCP
oncost collects GCP costs via the BigQuery billing export. Setup takes about 10 minutes.Prerequisites
- A GCP project with billing enabled
- Permission to create service accounts and enable BigQuery billing export
Step 1: Enable billing export to BigQuery
If you don’t already have billing export enabled:- Go to GCP Console > Billing > Billing export
- Click Edit settings under BigQuery export
- Select a project and dataset (create a new dataset if needed, e.g.,
billing_export) - Select Detailed usage cost export type
- Click Save
Step 2: Create a service account
- Go to GCP Console > IAM & Admin > Service Accounts
- Click Create Service Account
- Name it (e.g.,
oncost-billing-reader) - Grant the role BigQuery Data Viewer on the billing dataset
- Grant the role BigQuery Job User on the project
- Click Done
- Create a JSON key for the service account and download it
Step 3: Complete the connection
In oncost, go to Settings > Connections > New Connection > GCP:- Upload or paste the service account JSON key
- Enter the BigQuery dataset name (e.g.,
project-id.billing_export) - Click Test Connection to verify access
- Click Save
What oncost collects
- Daily cost breakdown by service, SKU, project, and region
- Usage quantities and units
- Labels applied to resources
- Credits and discounts
Troubleshooting
| Issue | Fix |
|---|---|
| ”Permission denied” | Verify the service account has BigQuery Data Viewer on the billing dataset and BigQuery Job User on the project. |
| No data | BigQuery export can take a few hours to start. Check the export settings in GCP Console. |
| Missing labels | Labels appear in the billing export automatically. Ensure resources are labeled in GCP. |