← Back

My on-call agent has to prove it before it blames a service

RootCause works out which microservice broke, then checks its answer against fresh data before it says anything. Why the loudest service usually isn’t the culprit, and why it’s allowed to say “I don’t know”.

When something breaks in a system of microservices, the first part of the incident usually goes to flipping between dashboards, trying to work out which service actually failed. And the loudest symptom usually isn’t the cause. When the payment service breaks, checkout and the front end light up too, because they’re waiting on it.

A confident wrong diagnosis is expensive: people go fix the wrong thing while the outage keeps going. So when I built RootCause, an on-call assistant, I wanted every answer to come with evidence you could check.

First, an answer key

You can’t grade a diagnosis if you don’t know the right answer. The OpenTelemetry Demo, a sample online store made of lots of microservices, comes with failure switches like paymentFailure and emailMemoryLeak. Flip one, and you know exactly what broke.

I built a simulator of a 15-service store that follows the demo’s shape and uses 10 of its failure switches. That gave me incidents where I already knew the culprit, so I could measure top-1 accuracy: did the agent name the right service and the right kind of failure?

How it works

RootCause is a LangGraph agent, and it’s strictly read-only. It never changes anything. A person decides what to do with what it finds.

  1. Detect: a forecast band on each metric flags when something drifts outside normal. No AI here.
  2. Triage: rank the services most likely to be at fault.
  3. Gather evidence: pull metrics, traces and logs for the top suspects.
  4. Check the runbook: find the runbook notes that match.
  5. Make a guess: propose a root cause.
  6. Prove it: confirm the guess, or go back and look again.

The checker asks its own questions

Instead of rereading the evidence the agent already used, the verifier asks fresh questions of its own: a later time window, with stricter thresholds. For a crash, for example, the suspect needs at least 10% errors on its own spans (and at least 3 spans), in a window that includes 4 fresh minutes the evidence step never saw.

If the answer holds up, RootCause reports it. If it doesn’t, the agent widens its search and tries again, up to 3 times. After that, it says “inconclusive” instead of guessing.

The red herring

My simulator has a deliberately noisy currency service that logs ERROR lines all the time, whether anything’s wrong or not. I put it there on purpose, because a service that’s noisy but healthy is exactly what fools a quick look at the logs.

I compared RootCause with a naive approach: blame whichever service has the most ERROR lines. That approach blamed currency in 28 of 30 incidents and got 6.7% right. RootCause got 96.7% (29 of 30). It looks at the signals that tell a culprit apart from its victims: errors on a service’s own spans, its own processing time, and its CPU and memory use.

These numbers come from simulated data, with a rule-based stand-in where the language model would go (more on that below). Across 5 random seeds (150 incidents and 50 healthy runs), RootCause scored 98.0%. Every time it confirmed an answer, it was right (147 of 147), and it raised 0 false alarms on the healthy runs.

When it says “I don’t know”

Every miss was the same case: a weak payment failure (paymentFailure at low intensity). The verifier couldn’t find enough errors in the fresh window, so the agent said “inconclusive”. It never gave a wrong answer with confidence.

I built it that way on purpose. It costs a little recall, but on call I’d rather hear “I can’t prove this yet” and keep looking.

The fancy model didn’t win

I also tried a real pretrained forecasting model (Chronos-Bolt, the tiny version) in place of my simple, robust linear forecaster. On this data it made no measurable difference (98.0% either way) and was about 7 times slower, so the simple one stayed.

That says more about my simulated data, which is close to a straight line plus noise, than about Chronos. On real production metrics, which have seasonal patterns, a learned forecaster may well win. But I only know which one to use because I measured both.

What it can’t do (yet)

  • The data is simulated. The service names and failure switches follow the OpenTelemetry Demo, but the effect sizes and noise are my own choices. I also tuned the thresholds on this same simulator. Real telemetry will be harder.
  • The reasoning step in these tests is a rule-based stand-in, not a real language model. So 96.7% is a result for the whole pipeline, not a measure of how good an LLM is. Testing against a real model is next.
  • It names one culprit per incident. When two things break at once, it reliably names one real culprit and never blames a victim, but it can’t report both yet.

What I took away

Make the agent prove its answer with data it hasn’t seen yet. Give it a way to say “I don’t know”. And measure the fancy option before you adopt it.

RootCause is built with Python, LangGraph, FastAPI, React and TypeScript, with parsers for Prometheus, Jaeger and JSON-lines logs, and it has 52 automated tests in CI. The repo is private while I finish it.