An empty view in karma does not mean “all is well”. If an upstream's healthcheck finds no matching watchdog alert, karma considers that Alertmanager broken and hides its alerts – even though all Alertmanagers are running.
Symptom
curl -s -u alice:lab-karma-pw-123 localhost:8000/metrics | grep '^karma_alertmanager_up'
karma_alertmanager_up{alertmanager="dev"} 1
karma_alertmanager_up{alertmanager="prod-1"} 0
karma_alertmanager_up{alertmanager="prod-2"} 0
karma_alertmanager_up{alertmanager="prod-3"} 0
The control room reports “prod is empty in karma”. amtool cluster show is happy, all three Alertmanagers are running.
Diagnosis
POST /alerts.json returns the state of every upstream with an error text.
curl -s -u alice:lab-karma-pw-123 -X POST -H 'Content-Type: application/json' \
-d '{}' localhost:8000/alerts.json | jq -c '.upstreams.instances[] | {name, error}'
{"name":"dev","error":""}
{"name":"prod-1","error":"Healthcheck filter \"prometheus-prod\" didn't match any alerts"}
{"name":"prod-2","error":"Healthcheck filter \"prometheus-prod\" didn't match any alerts"}
{"name":"prod-3","error":"Healthcheck filter \"prometheus-prod\" didn't match any alerts"}
Causes
env=productionThe filter no longer matches the watchdog
Someone “aligned” the healthcheck with the official environment name. The watchdog still carries env=prod. No match means to karma: upstream broken.
--check-config is greenThe file is valid, only the content is wrong
karma --check-config does not find the error – the syntax is fine. Only comparing with the real labels reveals it.
Fix
sed -i 's/ - env=production$/ - env=prod/' karma/karma.yaml docker compose restart karma docker compose restart caddy
Don't: Read an empty environment in karma as “no alerts” without checking karma_alertmanager_up.
Alertmanager and karma hands-on, Day 15: a competition on a broken control room with eight faults.
Go to day 15 →
FAQ
Why does karma need a healthcheck filter?
It checks that alerts really arrive through an Alertmanager – using a watchdog that always fires. Without it, karma does not trust that upstream.
How do I see this in monitoring?
karma_alertmanager_up drops to 0 for the affected upstreams; an alert on it reports the problem.