EN / ES · /

A post-release regression checker built on Loki

Case study · September 2026 · 2 min read

TypeScript/Node services on Kubernetes, logs in Loki, Grafana with a service account

The problem

A release went out missing a migration that another service needed. Nobody could enroll two-factor auth for a whole night, and we found out hours later. The error rate for a flow that few people use at night doesn't trip a generic alert, and by volume it looks like normal traffic.

The idea

Treat "a flow that used to produce events stopped producing them" as the signal, not just error rates. Three families of rules:

The build

A single Python script with no dependencies, authenticated against the Loki datasource with a Grafana service-account token. It runs once or in a loop every 30 minutes, keeps state in a local JSON file so the same alert isn't repeated within 6 hours, and posts to Slack through a webhook (or prints to stdout if the variable isn't set). About 70 instant queries per run, around 2 minutes. I chose a 3-day offset as the baseline after measuring that 7-day range queries took over a minute each; the detector has to be cheap enough to run forever.

Result

On its first production run it fired exactly once, on a known-signature rule, and the signal was real. The funnel-to-zero and error-ratio families produced zero false positives. A synthetic canary that exercises the enrollment flow on a schedule would have caught the broken release about 5.5 hours earlier than we actually found out.

What's next

Load the funnel and signature rules as Grafana alerts over Loki so detection doesn't depend on a script running on someone's machine, and add a synthetic canary that exercises the enrollment flow every 30 minutes so the baseline never depends on real users showing up at night.

What I'd tell another team