Who monitors the monitoring?

Setting up monitoring took me one day. Getting it to tell me the truth took eight months.

One day, one whole stack

On March 23 I installed the usual suspects on my k3s cluster: Prometheus and Grafana through Helm, then Loki and Promtail for logs. By the evening a Mac mini and Home Assistant were feeding metrics too.

The only real fight that day was Loki. I upgraded to 3.5.1 to get along with Grafana 12, and found out that Loki 3 doesn’t work with the loki-stack chart. So I went back to 2.9.10, the last 2.x release, cleaned the deprecated fields out of the config, and moved on.

It looked great. Lots of graphs. I felt very responsible.

Twelve days of nothing

Then summer happened, and my monitoring died twice without saying a word.

Prometheus was down for twelve days. Uptime Kuma was down for nine. Of course neither of them told me, because the thing that was broken was the thing that was supposed to tell me.

Part of this was self-inflicted. All the monitoring volumes lived on NFS from my Unraid box. Prometheus explicitly doesn’t support non-POSIX-compliant file systems, and Grafana and Kuma both run on SQLite. Every Unraid reboot destroyed the NFS handles and the pods never recovered. That happened four times between July and September.

The fix was to give up something I thought I wanted. The volumes moved to local-path, which pins each pod to one node and doesn’t replicate anything. For this data that’s fine: metrics expire after 15 days, logs after a week, and the dashboards are code in a repo.

There was a Grafana crash loop in the same period, and it’s a good example of how silly these can be. The loki-stack chart quietly ships its own datasource ConfigMap marked as default. Prometheus was also marked as default. Grafana saw two defaults and refused to start:

Only one datasource per organization can be marked as default

The dead man’s switch

Moving the volumes fixed the cause, but not the actual problem. Anything inside the cluster can die together with the cluster.

Prometheus ships with an alert called Watchdog that fires all the time, on purpose. Until September mine went nowhere. Now Alertmanager sends it as a webhook to Home Assistant, which runs outside the cluster. Every beat restarts a timer. Alertmanager repeats every 5 minutes and the timer runs for 15, so it takes three missed beats before Home Assistant tells me that the monitoring itself is dead.

It’s maybe ten lines of config, and it’s the most valuable thing in this whole post.

Then came the noise

Now alerts actually reached my phone through Telegram, which turned out to be its own problem.

My first filter for the Mac mini’s duplicate disk alerts was too aggressive. On macOS, / has been read-only since Big Sur, and NodeFilesystemSpaceFillingUp skips read-only file systems. With /System/Volumes/Data filtered out too, the Mac mini had no disk space alert at all. A real alarm had disappeared, and nothing looked wrong.

KubeJobFailed was the opposite. A backup job got OOM-killed on October 31 and the alert kept firing for days, because it fires as long as any failed job exists, even though the backup ran fine again from the next day on. I replaced it with a rule that only looks at the most recent run of each CronJob.

For a while an LLM read my logs and sent me warnings about recurring patterns. They were well written and hopelessly overdramatic. Every routine hiccup read like the beginning of the end. In October I replaced it with something much more boring: a daily status report in n8n with fixed traffic-light rules and an ignore list where every entry needs a written reason.

It doesn’t alert at all. Alertmanager does the real-time work and Kuma checks endpoints and certificates. The report shows the overall state once a day, so that silence actually means everything is fine. And after each run it sends a heartbeat to Kuma, because by now I don’t trust anything that can fail quietly.

Both of them were right

My favorite bug report of the year: Telegram said the internet was down and we were running on the 5G backup. The dashboard said everything was fine.

I assumed one of them was lying. Neither was. The DSL line had dropped for a few minutes and the gateway had failed over and back again before I got around to looking. The metrics also showed the same dip at about 4 AM on previous nights, which looks a lot like my provider’s scheduled reconnect.

The fix was changing for: 5m to for: 15m on that one alert. Alert timing is a blunt tool, though: elsewhere the same for: 5m hid a real outage from me, which is a story of its own.

A dashboard that looks like my rack

In July I wanted one screen for everything, shown on a Raspberry Pi touchscreen next to my 3D printers. Most of the data lived in Grafana, some in Home Assistant, and the rest in Kuma. I decided to build the overview in Home Assistant, because that’s where the buttons are.

The first version overlapped itself at the bottom and got rebuilt from the ground up in October. Then it got purple, to match the lighting of the rack it lives next to. It has a clock, a “KUBI Homelab” header, columns for devices, cluster and services, and one big status card that sums up everything into a single answer. That summary is the point of the whole thing. I don’t want to read graphs. I want to know whether I have to read graphs.

Not every idea survived. On November 2 the middle column got a big reorganization, I looked at it, and I had it rolled back the same day.

So the first thing I look at is that card, and when it says “Alles in Ordnung” (“everything’s fine”), that’s honestly very soothing. Even when the card right next to it says I have 102 updates waiting.

Two AI sessions and a contract

Here’s the part I didn’t see coming. I work on this with Claude Code, and I had one session for the Home Assistant repo and another for the cluster. At some point the two of them started sending each other work.

The Home Assistant session would need data for a new card and write a spec for the cluster session: this metric name, these labels, one series per object, value between 0 and 1. I approved it. The cluster session built it as Prometheus recording rules, tested them against real data, and reported back with an acceptance result. It even started a pod with a deliberately nonexistent image, just to prove that cluster_pod_problem would show it.

That handover is why the design works. Home Assistant never touches raw Prometheus metrics. It reads a small, stable vocabulary with prefixes like backup_*, cluster_*, net_* and update_*, and the ugly joins stay on the Prometheus side. The repo now has 52 recording rules and 34 alerts.

The messages between them were surprisingly useful:

  • The cluster session warned that {__name__=~"cluster_.*"} also matched more than 580 series from the chart’s built-in rules, and asked for a narrower query.
  • My gateway can’t run a speedtest, so a CronJob does it every four hours. It skips the test while on 5G to save data, and the cluster session told the dashboard session not to treat the stale timestamp as a failure in that case.

They also coordinated the Uptime Kuma upgrade from 1.23.17 to 2.5.7. One side took a backup and migrated the database, from 413 MB and almost three million heartbeats down to 142 MB with a 30-day retention. The other side rewired the Home Assistant integration. 25 of 26 monitors came back under their old entity names.

The 26th was a push monitor that simply hadn’t received a push since the upgrade. It was the heartbeat of the daily report. Naturally.

What I’d tell myself in March

  • Graphs aren’t monitoring. An alert that reaches you is.
  • Put one check outside the thing you’re checking.
  • Don’t run databases on NFS. Yes, I knew that already.
  • After every alert filter, test that a real alarm still gets through.
  • A boring report with fixed rules beats a clever one you have to double-check.
  • Give your dashboard a small contract of its own instead of letting it depend on raw metrics.

There’s still an idea on my list: when everything is fine, the status card should show a rotating joke. Something like “All good, go back to sleep.”

I’d say that’s the actual goal of all of this.