ENGINEERING

Slow-Query Budget Gate on Pull Requests

On every PR that touches ORM query code, derive a p95 latency envelope from Honeycomb for the affected query patterns and fail the check if a new or changed query is projected…

CategoryEngineering
Enginesim
Difficultyadvanced
Triggerevent
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerPR opened or updatedGitHubGitHub
  • LogicExtract changed ORM query patterns from diff
  • ActionFetch p95 latency for query shapesHoneycomb
  • LogicCompare p95 vs per-endpoint budget
  • OutputPost pass/fail commit status checkGitHubGitHub

What it does

This workflow turns Honeycomb's real production latency data into an enforceable budget that gates pull requests. When a PR changes ORM query code, it pulls the historical p95 latency for the matching query shapes, compares it against a per-endpoint budget, and posts a pass or fail GitHub check so slow queries never merge silently.

When to use it

Run it on any service where database latency is a recurring source of incidents and you want a hard line in CI rather than a post-deploy surprise. Best for teams already emitting query spans to Honeycomb.

How it works

  1. 1A pull request opened or synchronized event fires from GitHub.
  2. 2A logic step inspects the diff and extracts the ORM query patterns that were added or modified.
  3. 3A Honeycomb query fetches the p95 duration for each matching query shape over the trailing 7 days.
  4. 4A logic step compares each observed p95 against its configured budget and computes a pass or fail verdict with the worst offenders.
  5. 5A GitHub action posts a commit status check, blocking merge when any query is over budget.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect HoneycombDistributed traces and queries.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.