DATA OPS

BigQuery Scheduled-Query Failure Triage Agent

When a Datadog monitor fires on a BigQuery scheduled-query failure, an agent pulls the failing query's SQL and error, diagnoses the likely root cause.

CategoryData Ops
EngineSim + Paperclip
Difficultyadvanced
Triggerwebhook
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerDatadog monitor webhook on failureDatadogDatadog
  • ActionFetch failing query SQL and errorGoogle BigQueryBigQuery
  • LogicDiagnose root cause and route by severity
  • ActionCreate pre-filled triage ticketLinearLinear
  • OutputLink ticket in SlackSlack

What it does

It turns a raw BigQuery failure alert into an actionable, pre-triaged ticket. An agent gathers the failing scheduled query's definition and error message, reasons about the likely cause (schema drift, missing partition, permissions, quota), and opens a Linear issue so an engineer starts from a diagnosis instead of a blank alert.

When to use it

Use it when scheduled-query failures need a tracked, assignable work item rather than just a ping, and when you want first-pass root-cause analysis done automatically. Good for teams that manage data-pipeline work in Linear.

How it works

  1. 1A Datadog monitor webhook fires when a scheduled-query failure is detected.
  2. 2A BigQuery action retrieves the failing query's SQL definition, last error, and recent run history.
  3. 3An agent step analyzes the error against the SQL to propose a root cause and a candidate fix.
  4. 4A logic step routes by severity and assigns the right owning team label.
  5. 5A Linear action creates a ticket with the diagnosis, SQL excerpt, error, and suggested fix.
  6. 6A Slack output links the new ticket into the data-eng channel.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect DatadogMetrics, traces, log search.
  2. 2
    Connect BigQueryDatasets, queries, schemas.
  3. 3
    Connect LinearIssues, projects, cycles, triage.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    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.