Monitoring

Measure the thing that actually moves

Every metric I keep answers a question I've actually asked. The list is short because most metrics answer nothing, and a dashboard full of them is worse than no dashboard: you stop looking.

The shape

Collectors on the left feeding two stores. Node exporter, kube-state-metrics and blackbox-exporter feed Prometheus; Grafana Alloy ships logs to Loki. Both stores feed Grafana, and Prometheus also feeds Alertmanager, drawn in amber. The diagram stops there: where a firing alert goes next is on the alerting page.
Collectors in, dashboards and alerts out. Prometheus holds the numbers and Loki holds the logs, and Grafana draws both. An alert goes to Alertmanager, and from there it is someone else's story: the alerting page covers where it goes and who it wakes.

One metrics store, one log store, one dashboard tool. Prometheus and Alertmanager and Grafana come from a single well-worn chart rather than three decisions, because what is actually portable is the rule format and the query language. Metrics are scraped; logs are shipped from every pod by Grafana Alloy. Nothing is sampled down and nothing is thrown away early.

Nodes: the question that started this

A node kept looking unstable, and the obvious metrics were useless. Load average was low. iowait was 0.1%. Neither number moved, and neither number means what people think it means.

The dashboard I built instead answers these, in this order:

What that found: one reboot, once, after seven days of uptime, with no metric explaining it. The node wasn't sick. The earlier framing — flaky node, degraded disk — was wrong, and it was wrong because the first metrics I looked at couldn't have told me either way.

What else is worth watching

Did it reconcile

Git is the source of truth, so a resource that won't reconcile is the failure mode that matters. Alerts fire on the outcome — still not ready after fifteen minutes — rather than on every attempt.

Is it reachable

blackbox-exporter probes each published hostname from outside the cluster, so "the site is up" is measured rather than assumed. Certificate expiry is watched separately, because a cert that expires in silence looks like an outage at 2am. The single sign-on issuer is probed the same way but on its discovery document rather than its host root, because a pod that is Running says nothing about whether the document a relying party fetches is being served.

Where the traffic goes out

An exporter records which route egress leaves by and what public address it presents. Both have to match what I expect, because a failure here looks like a random third of the cluster being broken.

Billing and transfers

The API provider's spend, and the nightly offsite copy. Both are things that quietly stop working and only matter the day you need them.

Storage

Volume usage per filesystem, and the shared file share. Every one of these has a known behaviour when it fills up, and all of them are boring until they do.

Jobs that should have run

Anything scheduled is alerted on its absence, not just its failure. A cron job that stops being scheduled produces no error at all, which is the worst kind of silent.

Dashboards

One dashboard per question I actually ask: nodes, image scanning, provider billing, logs, and the storage boxes. The node one has the most panels because it's the one I open under pressure.

Dashboards are files in the repository next to the alert rules, so a panel is reviewed the same way a rule is. The first version of the node dashboard had panels that looked right and queried the wrong label, and the review caught it.

Every panel is checked against real data before it ships

Each query is run against the live store and its result histogrammed, because a panel that returns nothing looks exactly like a system with nothing wrong. "No data" and "no problems" are the same picture, which is the most expensive mistake in monitoring.

The node dashboard. The one I open under pressure. Four questions, and the bottom one is the answer to "is this machine sick".

What isn't measured