DATA OPS

BigQuery Cost Spike Detector with Microsoft Teams Alert

Triggered by a BigQuery export webhook, compares a team's just-completed query cost against its trailing average and, on an anomalous spike.

CategoryData Ops
Enginesim
Difficultyadvanced
Triggerwebhook
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerBigQuery job-completion webhookHTTP webhook
  • ActionFetch team's trailing 30-day baseline costGoogle BigQueryBigQuery
  • LogicCompute spike ratio vs baseline
  • LogicExit if within normal range
  • OutputPost spike alert with SQL to MS TeamsMicrosoft Teams

What it does

Reacts in near real time to completed BigQuery jobs: when a single query from any team costs far more than that team's recent baseline, it surfaces the query text and cost to a Microsoft Teams channel so someone can intervene before the bill compounds.

When to use it

When a single fat-finger query (a missing partition filter, a cross join) can cost hundreds of dollars and you cannot wait for tomorrow's digest. Use it for live spike interception rather than scheduled reporting.

How it works

  1. 1A webhook trigger receives a BigQuery job-completion event (via log export / Pub/Sub bridge).
  2. 2A BigQuery action fetches the trailing 30-day average cost for that job's team label.
  3. 3A logic step computes the ratio of this job's cost to the baseline and checks the spike threshold.
  4. 4If the job is not anomalous, the flow exits quietly.
  5. 5On a spike, an MS Teams action posts the team, cost, multiple-over-baseline, and the SQL for quick triage.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect BigQueryDatasets, queries, schemas.
  2. 2
    Connect Microsoft TeamsChannels, chats, files.
  3. 3
    Connect HTTP webhookTrigger any URL on agent actions.
  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.