Failure Scenarios
Twelve ways monitoring breaks, and how each looks
Monitoring fails in quieter ways than the systems it watches. A broken database throws errors. A broken alert just doesn't fire, and you find out during the outage it should have caught. These are the failures worth recognising on sight.
| # | Failure | What you see | Where to look | Fix |
|---|---|---|---|---|
| 1 | Target down | up == 0; series go stale; gaps | /targets "Last error" | Network, DNS, port, TLS, or the process itself |
| 2 | Scrape timeout | up == 0 while the exporter is running; scrape_duration_seconds near scrape_timeout | /targets; exporter logs | Raise the timeout, make the exporter cheaper, scrape less often |
| 3 | Cardinality explosion | Memory climbing, slow queries, eventually OOM restarts | TSDB status page; scrape_series_added | Drop at scrape, fix in code, add sample_limit |
| 4 | OOM restart loop | Prometheus restarts repeatedly; long gaps | docker logs; container exit code 137 | Raise memory to get it up, then find the cardinality source |
| 5 | Disk full | Ingestion stops; WAL errors in logs | node_filesystem_avail_bytes; TSDB size | retention.size as a safety net; bigger volume; less retention |
| 6 | Invalid config reload | Nothing changes after an edit | prometheus_config_last_reload_successful; logs | promtool check config in CI; alert on reload failure |
| 7 | Silently broken rule | An alert that never fires | /rules errors; prometheus_rule_evaluation_failures_total | Unit tests; pint; absent() companions |
| 8 | Renamed metric or label | Dashboards say "No data"; alerts select nothing | Compare the exporter's /metrics before/after upgrade | Pin exporter versions; read changelogs; absent() alerts |
| 9 | Alerts not delivered | Alerts firing in Prometheus, no notifications | /alerts vs Alertmanager UI; alertmanager_notifications_failed_total | Receiver credentials, routing tree, an over-broad silence |
| 10 | Alertmanager unreachable | Firing alerts never reach Alertmanager | prometheus_notifications_errors_total; prometheus_notifications_dropped_total | Network, AM cluster health, Watchdog heartbeat |
| 11 | Clock skew | "out of bounds" or "too old" samples; strange rates | Logs; node_timex_offset_seconds | NTP/chrony on every host |
| 12 | Expensive query | Prometheus CPU pegged, everyone's dashboards slow | queries.active; prometheus_engine_query_duration_seconds | --query.timeout, --query.max-samples, recording rules |
Reading the signals
A few patterns that recur in incidents:
"The graph has a gap." Either the target wasn't scraped (check up
over that period), or Prometheus itself wasn't running (check
process_start_time_seconds{job="prometheus"} for a restart, then the
WAL replay time). If up is missing too, it was Prometheus.
"The alert didn't fire." Work through the chain in order. Did the
expression return anything at that time? Run it in the UI with the
time picker set to the incident. Was it pending long enough for for?
Check ALERTS_FOR_STATE. Did Prometheus send it? Check notification
errors. Did Alertmanager route it? Use amtool config routes test. Was
it silenced or inhibited? Check the Alertmanager UI's silenced filter.
"The rate dropped to zero and came back." Usually a scrape failure
or a restart in the window, not a real traffic drop. Look at up and
resets() for the same period.
"Numbers are different in Grafana and Prometheus." Usually different
step or rate window: Grafana's $__rate_interval changes with zoom
level. Use the panel's Query inspector to see the exact query and step
Grafana sent.
After every incident, ask two monitoring questions alongside the root cause: "Did we get alerted, and how early?" and "Which dashboard showed the problem first?" The answers decide which alerts to add, which to delete, and which panels to promote to the top of the dashboard.
Game day
Run these against the lab stack, one at a time. For each, write down what alerted, how long it took, and what the dashboards showed, before you look at the cause.
# 1. a service fails
curl -X POST 'localhost:8080/admin/chaos?error_rate=0.5'
# 2. a service gets slow
curl -X POST 'localhost:8080/admin/chaos?error_rate=0.01&extra_latency_ms=800'
# 3. a target disappears
docker stop demo-app
# 4. an exporter loses its database
(cd ../postgres && docker compose stop)
# 5. the alerting path breaks
docker stop alertmanager # what tells you? (hint: only the Watchdog, if routed externally)
# 6. bad config is deployed
# break config/prometheus.yml, then: curl -X POST localhost:9090/-/reload
# 7. the batch job stops running
# don't run batch_job.py for a day; does anything notice?Scenario 7 should reveal a gap: there's no alert on the backup's age yet.
Write one using time() - nightly_backup_last_success_timestamp_seconds,
plus an absent() companion for when the metric was never pushed at all.