Skip to content

Commit

Permalink
Adds Compute Engine costs to the bq_billing query results (#1062)
Browse files Browse the repository at this point in the history
* Adds GCE costs to bq_billing query results

We want to start alerting on significant changes to Compute Engine costs over
some number of days. This commit adds metrics for Compute Engine that we can
alert on.

* Adds missing comma to SQL in bq_billing.sql
  • Loading branch information
nkinkade authored Oct 16, 2024
1 parent 81b6e3d commit 873f9ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/federation/bigquery/bq_billing.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ SELECT
SUM(IF(period = "month" AND service = "BigQuery", cost, 0))/30 AS value_average_daily_bigquery,
SUM(IF(period = "today" AND service = "BigQuery", cost, 0)) AS value_today_bigquery,
SUM(IF(period = "yesterday" AND service = "BigQuery", cost, 0)) AS value_yesterday_bigquery,
SUM(IF(period = "before_yesterday" AND service = "BigQuery", cost, 0)) AS value_before_yesterday_bigquery
SUM(IF(period = "before_yesterday" AND service = "BigQuery", cost, 0)) AS value_before_yesterday_bigquery,
-- Compute Engine metrics.
SUM(IF(period = "month" AND service = "Compute Engine", cost, 0))/30 AS value_average_daily_gce,
SUM(IF(period = "today" AND service = "Compute Engine", cost, 0)) AS value_today_gce,
SUM(IF(period = "yesterday" AND service = "Compute Engine", cost, 0)) AS value_yesterday_gce,
SUM(IF(period = "before_yesterday" AND service = "Compute Engine", cost, 0)) AS value_before_yesterday_gce
FROM
billing
billing

0 comments on commit 873f9ab

Please sign in to comment.