get_cost_breakdown
Summarize recent Google Cloud spend from BigQuery billing data, grouping costs by service, SKU, project, or region to identify cost-optimization opportunities.
Instructions
Summarize recent spend from the BigQuery billing export.
By default this reports spend for the selected environment's project only. A billing export table covers every project on the billing account, and several environments commonly share one table, so an unfiltered query would return identical account-wide totals for staging and production.
Only the environment holding the export needs 'billing_export_table' set: one billing account exports to one project, and that export already covers every project on the account. Asking any other environment for costs returns an error naming the one that has it.
Args: group_by: One of 'service', 'sku', 'project', 'region'. Default 'service'. days: Lookback window in days over usage_start_time. Default 30. limit: Max rows returned (highest net cost first). all_projects: Report the whole billing account instead of just this environment's project. Pair with group_by='project' to compare projects; the totals then are not specific to this environment. environment: Which configured GCP environment to bill against, e.g. 'staging' or 'production'. Omit to use the default environment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| limit | No | ||
| group_by | No | service | |
| environment | No | ||
| all_projects | No |