Anomaly detection

The four signals Rocketgraph checks every five minutes, how it decides what is usual, and what has to be true before anything is flagged.

Anomaly detection

About every five minutes, Rocketgraph asks your backend for every service's requests, errors and latency in one query. It compares each service with what is usual for it, and flags what is clearly out of line.

There is no composite health score. Each signal is a rule you can explain in one sentence.

The four signals

1. Error rate. Fires two ways:

  • Absolute. More than 25% of a service's requests are failing. This fires whatever the history says, even on day one.
  • Relative. The error rate is at least 3 times what is usual for this service.

2. Latency. The slowest 5% of requests (p95) are at least 2.5 times slower than usual. This catches the case where traffic and errors look fine but everything is slow.

3. New log patterns. A log line shape that has never been seen before, appearing at least 3 times. See Log patterns.

4. A service went silent. A service that was reporting has sent nothing for 15 minutes, while other services are still reporting. A crash-looping service has no error rate and no latency, so the first two signals can't see it.

What "usual" means

A single baseline is easy to fool. If the last hour was quiet, everything looks like a spike. If traffic grew last week, every afternoon looks like an incident. So each value is compared with six baselines at once:

Baseline What it answers
Last hour Did this just change?
Last 6 hours Has today drifted?
Last 24 hours Is the whole day different?
Same hour of day, past 7 days Is 09:00 always like this?
Same hour, one week ago Was last Tuesday at 09:00 the same?
Same hour of the week, over several weeks Is Monday morning always busy?

The last one is the time-of-week baseline. It is what stops a nightly batch job or the Monday morning rush from looking like an incident.

Each baseline votes "normal" or "exceeded". A signal fires only when at least 60% of the voting baselines agree.

A baseline with too little history does not vote. It does not count as zero. A missing baseline read as zero would make every ratio infinite and flag everything.

A baseline that doesn't reach back far enough does not vote either. With two hours of history, "last 24 hours" is really "last 2 hours", so it abstains.

With only one baseline able to vote, it must agree on its own, and the result is marked provisional and counts for half. That is what makes detection useful in the first hour without pretending one comparison is a consensus.

What triggers, and what doesn't

Before anything is flagged, it has to get through these checks, cheapest first:

  1. Volume floors. A service needs at least 50 requests in the five-minute window for error rate and latency, and at least 5 errors for error rate. Six requests that all failed is 100%, and means nothing.
  2. Baseline agreement. As above.
  3. It has to hold. The same signal on the same service must fire in 2 windows in a row. One bad window is usually a deploy, a restart or a gap in data.
  4. The score. Each finding gets a score from 0 to 1. The scores for a cycle are added up. Below 0.7, nothing is flagged.

How each signal counts towards that score:

Signal Weight
Error rate 1.0
Service went silent 1.0
Latency 0.7
New log patterns 0.6 at most

What that means in practice:

Situation Score Flagged?
Error rate, all baselines agree 1.0 Yes
Service went silent 1.0 Yes
Latency, all baselines agree 0.7 Yes
Error rate on a thin history (provisional) 0.5 Only with something else
Latency, 2 of 3 baselines agree about 0.47 Only with something else
New log patterns, nothing else moving 0.2 to 0.6 No

New log lines on their own never get flagged. A deploy that adds twenty new log lines and breaks nothing stays quiet. The same lines next to an error rate that moved do count.

Outages don't become "normal"

While the five-minute checks have a service flagged, its windows are not learned from. A flag clears after an hour of clean windows. Without this, a long outage would slowly teach the baseline that the outage is normal, and detection would go quiet when you need it most.

Where the model comes in

The checks above are plain arithmetic. No model is called for them.

Once an hour, Rocketgraph sends Claude a summary of the last hour: what these checks flagged, every service's numbers, error logs for the flagged services, alerts from your own tools, and the incidents already known today. Claude decides which problems are new and writes up the root cause. See Incidents.

The detection checks decide what counts as evidence. The hourly review decides what becomes an incident.

Known limits

  • A brand new service has no history. Until it has a few windows, only the 25% error-rate rule and the silent-service rule can fire for it.
  • The time-of-week baseline keeps 8 observations per hour of the week and needs 3 before it votes. It takes about three weeks to be ready everywhere, and it follows a real change in your traffic over a few weeks.
  • If more than half of your services go silent at once, Rocketgraph treats that as a problem reading your backend, not as dozens of separate incidents.
  • Latency needs latency data from your backend. Some backends don't report it for every service.
  • The thresholds are the same for every organisation. You can't change them today.