Personal project by Ulf Fäldt Reifenberg · December 2026 · unofficial, not affiliated with Grafana Labs
Who should run the queries: code or the model?
An alert fires on one service; the fault is somewhere else. An AI assistant can find it two ways. Code runs a fixed set of PromQL checks and the model reads the table in one call, or the model writes its own PromQL and runs it through Grafana's MCP server. This page measures both on 18 simulated incidents with a known cause, next to a rule written in plain code.
Loading…
What was run
- Incidents: a simulated shop with 8 services and a call graph. 18 incidents, each with 26 hours of metrics at one-minute resolution ending when the alert fires: 4 bad deploys, 4 memory leaks, 4 CPU saturations, 3 database pool exhaustions and 3 traffic surges. In 16 of 18 the alert is on a different service than the cause, and 10 carry an unrelated deploy as a false lead. Metric and label names say nothing about the fault.
- Stack: the series are backfilled into a real Prometheus (v3.5.0) behind Grafana 12.2.1. The agent queries through Grafana's open-source MCP server,
mcp-grafana2.5.0, using itsquery_prometheustool. All of it runs locally in Docker. - Alert only: blame the service the alert is on. The floor.
- Rule: about 25 lines of code over the checks: take the deepest abnormal service in the call graph, read the fault class from its strongest signal. Written before any model run and not changed afterwards.
- Checks, then one call: code runs 7 PromQL checks per service at the alert time and the same time yesterday, adds the call graph and recent deploys, and the model reads that table once. No verdicts in the table, only numbers.
- Agent: the model gets the alert, the metric catalogue and at most 5 queries (instant or range). It writes the PromQL itself.
- Models: Llama 3.1 8B and Llama 3.3 70B on Cloudflare Workers AI, temperature 0, one run per cell. An answer counts as right only when the root service and the fault class are both right.
Results
18 incidents per arm. Intervals are 95% bootstrap intervals over incidents (10,000 resamples). Input tokens and calls are averages per incident. "Failed queries" are queries that returned an error or no series.
Paired differences
By fault class (both right)
Incident by incident
✓ both right · s service only · c class only · ✗ neither
Trace explorer
Pick an incident and an arm to see what the model was given, the queries it wrote and what came back.
Limits
- 18 incidents from one simulator that I wrote, with one seed each. The intervals are wide, and a simulator is cleaner than production: one fault at a time, no missing series, no noisy neighbours.
- Metrics only. No logs, traces or profiles, which is where much real root-cause evidence sits. The service graph is given as a metric.
- I wrote both the faults and the checks, so the fixed checks cover every signal the faults produce. In production the unknown fault is the one no check was written for; that is the case this setup cannot show and where a querying agent should earn its keep.
- Small open models with prompted JSON instead of native tool calling, one untuned prompt per arm, at most 5 queries. Frontier models would write better PromQL; this does not measure Grafana Assistant or any Grafana product.
- The agent used one of the MCP server's tools (
query_prometheus); the metric catalogue was given in the prompt rather than discovered with the list tools. - One run per cell at temperature 0; neurons are metered from token counts with Cloudflare's published rates.
About. Built by Ulf Fäldt Reifenberg for an application to Grafana Labs, with coding agents doing the implementation. Unofficial; it uses Grafana's and Prometheus's open-source software and says nothing about Grafana's internal systems. The data is synthetic. Grafana Labs publishes its own, much larger benchmark for observability agents, o11y-bench; this page asks one narrower question. Contact: LinkedIn.