Which of your alerts are worth their page? Lapilli replays alert rules against what actually went wrong: a weekly verdict, or every hour in a ledger with a dashboard.
Which of your alerts are worth their page? lapilli verdict judges every
firing against what actually went wrong: a white stone when the alert caught an
incident, a black stone when nothing was wrong. Count a rule's stones over a
week and you know whether it earns its place; an incident with no stone is one
your alerts missed. lapilli serve keeps judging, every hour, in a ledger with
a dashboard, where teams follow the noisy rules and missed incidents up
(Keep judging). It reads by default; turned on, it also makes the
changes it proposes, each once a person has approved it: as a pull request
to where the rule is kept, or, for a rule kept nowhere else, through the API
that holds it (Changing rules).
The core is the replay and the verdict on it: lapilli verdict,
--check-replay, and the pull request backtests built on them.
lapilli serve runs that same core every hour and keeps what it finds. What
it adds (the ledger, the pages, sign-in, making approved changes) is
optional: the core needs none of it.
$ lapilli verdict --rules alert-rules.yaml --prometheus http://prometheus:9090 \
--incidents incidents.yaml --impact 'sum(rate(http_5xx[5m])) / sum(rate(http_total[5m])) > 0.01'
Lapilli 2026-10-26 00:00 → 2026-11-02 00:00 Asia/Seoul (+09:00)
148 firings, 3 incidents written down, 1 more found by --impact
RULE SEVERITY FIRED ○ CAUGHT ● NOTHING PRECISION REFIRED
ExportJob5xx critical 118 0 118 0% 41
CheckoutLatencyP99 warning 14 2 12 14% 3
ReadReplicaLag warning 9 1 8 11% 0
NodeNotReady critical 4 0 4 0% 0
DBPrimaryCPU critical 3 2 1 67% 0
Noisy rules that a longer "for" would quiet, still catching every incident they caught:
RULE FOR FIRED INCIDENTS CAUGHT LATER BY
ExportJob5xx 5m → 15m 118 → 31 0 –
CheckoutLatencyP99 5m → 10m 14 → 6 1 up to 4m
Out of hours, in Asia/Seoul (at work mon-fri 08:00-18:00, asleep 22:00-08:00):
of the firings that caught nothing, 57 came while people slept, and 37 more off hours.
RULE SEVERITY ● ASLEEP ● OFF HOURS ● AT WORK
ExportJob5xx critical 52 31 35
NodeNotReady critical 3 0 1
ReadReplicaLag warning 2 1 5
CheckoutLatencyP99 warning 0 4 8
DBPrimaryCPU critical 0 1 0
What each rule adds: the incidents it caught, those it caught before any other rule, those no other rule caught:
RULE INCIDENTS FIRST ALONE
CheckoutLatencyP99 1 0 0
DBPrimaryCPU 1 1 1
ReadReplicaLag 1 1 1
A noisy rule's catch doesn't count beside one by a rule that isn't noisy.
38 rules never fired: CertificateExpiring, DiskWillFillIn4h, EtcdNoLeader, KafkaUnderReplicated, NodeClockSkew, PodCrashLooping, PVCAlmostFull, RedisDown, TargetDown, WatchdogMissing and 28 more, all in --json.
INCIDENT START LASTED CAUGHT BY
INC-41 Checkout errors 2026-10-28 12:01 38m DBPrimaryCPU +2m, CheckoutLatencyP99 +6m (noisy)
INC-42 Search timeouts 2026-10-30 09:15 1h12m ReadReplicaLag -3m
INC-43 Batch stuck 2026-10-31 02:40 – ✗ nothing fired
impact-1 user impact (--impact) 2026-11-01 21:27 24m ✗ nothing fired
✗ 2 of 4 incidents had no alert.
! --impact-for 5m counts impact that lasted 5m as an incident, but 9 of the 43 rules judged fire only once
their condition held longer: their "for" and one evaluation, with no "for" an evaluation (6m for 6
of them). Impact shorter than that they can't be sure to catch. --impact-for 6m counts only what they can.
Status: early, with one maintainer and room for more (MAINTAINERS.md). Checked against one production Grafana: all 71 of its alert rules replay, and a four-week replay of the rules as they stood then found 177 firings of the noisiest rule, the number of notifications its team had counted by hand in their alert channels. Weekly counts of critical alerts came within 10% of theirs in three of the four weeks. The replay is also checked against real servers, by anyone who runs it: CI's
e2e-compatjob (test/e2e/compat.sh) runslapilli verdict --check-replayagainst a real Prometheus, Thanos and VictoriaMetrics with vmalert, and every firing must be alike, and the weeklyupstreamworkflow runs it again on each server's latest release (Check the replay).e2e-kubernetes(test/e2e/kubernetes-rules.sh) does the same on a real rule set: kube-prometheus-stack's default alert rules, as shipped, on a kind cluster with failures made on purpose.
go install lapilli.dev/cmd/lapilli@latest
lapilli demo
lapilli demo replays seven made-up rules over a week of history made up
in the process, and prints a report like the one above: nothing to
connect, nothing read or sent. lapilli demo --serve shows the same week
in lapilli serve's pages, read-only, on this machine alone. Then
Getting started does the same on your own rules.
Alert rules pile up. One is added after each incident, few are taken away, and nobody can say which ones still earn their page. The way teams find out is by hand: read a week of alert channels next to the incident notes, mark each alert as useful or no
A run against a real Amazon or Azure managed Prometheus workspace
https://github.com/lapilli-project/lapilli/issues/132
Labels: help wanted
Spanish UI: a native speaker's review
https://github.com/lapilli-project/lapilli/issues/131
Labels: good first issue, help wanted
Japanese UI: a native speaker's review
https://github.com/lapilli-project/lapilli/issues/130
Labels: good first issue, help wanted
Thank you for looking. The most useful contribution of all is a report of a
rule that Lapilli can't replay, or replays differently from how it really
fired, which lapilli verdict --check-replay finds. Include the rule, with names and thresholds changed if you like, and,
if you can, what really fired; the issue form "A replay that differs" asks
for each. After that, see ROADMAP.md for areas that need
someone, and MAINTAINERS.md for how contributing leads to
maintaining. To start small, an issue labelled
good first issue says where its change goes
and when it's done; one labelled
help wanted needs an account or a language
the maintainer doesn't have. Say in a comment which one you're taking.
Questions and ideas are welcome in Discussions, and an idea for a larger change is best talked over there before its design note. Everyone taking part follows the Code of Conduct.
Go 1.26.11 or later, as go.mod says; CI tests the latest Go too, which
releases are built with. The recipes' tests need sh, curl and jq, and
are skipped without them.
go build ./cmd/lapilli # the lapilli binary
go test -timeout 20m ./... # everything: ten minutes or more, most of it serve's; go test's own ten is too short
test -z "$(gofmt -l .)" && go mod tidy -diff && go vet ./... # as CI checks them
(cd test/parsediff && go test -mod=mod ./...) # the readers of PromQL and LogQL against Prometheus, MetricsQL and Loki
test/fuzz.sh # every fuzz test, two minutes each (FUZZTIME); --list names them, --changed takes paths on stdin
test/e2e/run.sh # the Helm chart on a kind cluster; needs Docker, kubectl, helm
test/e2e/changes.sh # changes to rules on a real Prometheus, Gitea, Grafana and Mimir; needs Docker, git, curl, jq
test/e2e/loki.sh # rules in LogQL replayed against a real Loki and Grafana; needs Docker, jq
test/e2e/signin.sh # lapilli's own sign-in against a real Dex; needs Docker, curl
test/e2e/postgres.sh # serve on a real Postgres: a restart, a second serve that follows, a copy in and out; needs Docker, curl, jq, python3
test/e2e/replicas.sh # three serves on one Postgres ledger on kind, the leader killed; needs Docker, kubectl, helm, jq
test/e2e/backtest.sh # pull request backtests on a real Gitea and Prometheus: the comment and the commit status; needs Docker, git, curl, jq
test/e2e/serve-lb.sh # the chart at a URL on kind: a LoadBalancer, Gateway API, an Ingress, Dex; Linux
test/e2e/rendered.sh # rules a chart renders, from a real Gitea, replayed and followed; needs Docker, jq, helm, yq
test/e2e/dashboard.sh # the chart's Grafana dashboard on a real Grafana and Prometheus; needs Docker, jq, python3
test/e2e/service.sh # the whole service on kind: Grafana's alerts, Lapilli at a LoadBalancer, Dex, a browser; Linux
test/e2e/ratelimit.sh # runs at once against a real Prometheus behind nginx's rate limit (429); needs Docker
test/e2e/compat.sh # verdict and --check-replay against a real Thanos, and VictoriaMetrics with vmalert; needs Docker, jq
test/e2e/kubernetes-rules.sh # --check-replay of kube-prometheus-stack's default rules beside what Prometheus fired, on kind; about 40 minutes; needs Docker, kubectl, helm, jq
test/e2e/measure.sh # the replay's measurements taken again at any version of Prometheus, Grafana and Loki (the images from the environment), into internal/replay/testdata; an hour; needs Docker, Go, curl, jq, yq
test/e2e/rollouts.sh # --rollouts read from a real kube-state-metrics on kind: restarts, scales, a rollback, an autoscaled Deployment; about 35 minutes; same needs
test/e2e/routing.sh # the notifications worked out from an alert manager's configuration beside those two real Alertmanagers (newest, oldest held to) sent to a webhook; about nine minutes; needs Docker, jq
test/a11y/axe.sh # axe-core (WCAG 2.2 AA) over every page, in a headless Chromium; needs Go and Docker
With LAPILLI_TEST_POSTGRES naming a Postgres server (15 or later), the
ledger's, serve's and the command's tests keep their ledgers there, each in
a schema of its own, which the test drops:
docker run -d --name lapilli-pg -e POSTGRES_PASSWORD=pw -p 127.0.0.1:55432:5432 postgres:18
LAPILLI_TEST_POSTGRES='postgres://postgres:pw@127.0.0.1:55432/postgres?sslmode=disable' \
go test ./internal/ledger ./internal/serve ./cmd/lapilli
CI runs them in three shards on each of Postgres 15 and 18, as
test/shard.sh 1, 2 and 3 do: the first the ledger's and the
command's, the second every other of serve's tests, the third the rest of
serve's. Each checks first that every test is in one shard, and one only.
A statement that Postgres takes otherwise than SQLite is given for both
(internal/ledger/dialect.go); TestDialectSeam says where one isn't. A
migration comes in a pair: internal/ledger/schema/NNN.sql and
internal/ledger/schema/postgres/NNN.sql.
Its changelog entry says Ledger schema NNN, which release can't open
the ledger after, and to keep a copy first, pointing to the chart's
README, "Going back after a schema upgrade"; and it gets a row in
docs/upgrading.md's table, as TestSchemasDocumented
holds. So do a route of /api/v1 in docs/api.md, a metric
in docs/metrics.md, and an option in
docs/commands.md, which is the help itself:
go test ./cmd/lapilli -run TestCommandsDocumented -write-docs writes it
again.
go test ./internal/ledger ./internal/serve -run Scale -v measures the
ledger and the pages over twelve weeks of a busy ledger, about 200,000
firings; LAPILLI_SCALE=10 makes it two million. The ledger's runs and
reads are held