DATA OPS

BigQuery Scheduled-Query Budget Breach Alert with Coda Ledger

Monitors the cost of BigQuery scheduled (recurring) queries against per-team monthly budgets, logs each run to a Coda budget ledger.

CategoryData Ops
Enginesim
Difficultyadvanced
Triggerschedule
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerHourly schedule
  • ActionRead scheduled-query jobs by team labelGoogle BigQueryBigQuery
  • ActionUpsert month-to-date cost to Coda ledgerCodaCoda
  • LogicCompare MTD spend to team budget
  • ActionOpen PagerDuty incident on breachPagerDutyPagerDuty
  • OutputStamp breach event into Coda ledgerCodaCoda

What it does

Tracks only the automated scheduled queries in BigQuery, attributes their running cost to the owning team label, accumulates month-to-date spend in a Coda ledger, and escalates via PagerDuty the moment a team crosses its monthly budget.

When to use it

When runaway recurring queries (not ad-hoc ones) are the real budget killer and you need a hard stop signal, not just a friendly nudge. Ideal for teams with strict per-quarter data budgets.

How it works

  1. 1A scheduled trigger runs hourly.
  2. 2A BigQuery action reads `INFORMATION_SCHEMA.JOBS` filtered to scheduled-query jobs in the last hour, grouped by team label.
  3. 3A Coda action upserts each team's month-to-date cost into a budget tracking table.
  4. 4A logic step compares month-to-date spend to each team's stored budget.
  5. 5If a team exceeds 100% of budget, a PagerDuty action opens an incident assigned to the team owner.
  6. 6A Coda action stamps the breach event and timestamp into the ledger for the audit trail.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect BigQueryDatasets, queries, schemas.
  2. 2
    Connect CodaDocs, packs, automations.
  3. 3
    Connect PagerDutyIncidents, on-call, escalations.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.