Learn Labs
Security & Operations

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.

#FailureWhat you seeWhere to lookFix
1Target downup == 0; series go stale; gaps/targets "Last error"Network, DNS, port, TLS, or the process itself
2Scrape timeoutup == 0 while the exporter is running; scrape_duration_seconds near scrape_timeout/targets; exporter logsRaise the timeout, make the exporter cheaper, scrape less often
3Cardinality explosionMemory climbing, slow queries, eventually OOM restartsTSDB status page; scrape_series_addedDrop at scrape, fix in code, add sample_limit
4OOM restart loopPrometheus restarts repeatedly; long gapsdocker logs; container exit code 137Raise memory to get it up, then find the cardinality source
5Disk fullIngestion stops; WAL errors in logsnode_filesystem_avail_bytes; TSDB sizeretention.size as a safety net; bigger volume; less retention
6Invalid config reloadNothing changes after an editprometheus_config_last_reload_successful; logspromtool check config in CI; alert on reload failure
7Silently broken ruleAn alert that never fires/rules errors; prometheus_rule_evaluation_failures_totalUnit tests; pint; absent() companions
8Renamed metric or labelDashboards say "No data"; alerts select nothingCompare the exporter's /metrics before/after upgradePin exporter versions; read changelogs; absent() alerts
9Alerts not deliveredAlerts firing in Prometheus, no notifications/alerts vs Alertmanager UI; alertmanager_notifications_failed_totalReceiver credentials, routing tree, an over-broad silence
10Alertmanager unreachableFiring alerts never reach Alertmanagerprometheus_notifications_errors_total; prometheus_notifications_dropped_totalNetwork, AM cluster health, Watchdog heartbeat
11Clock skew"out of bounds" or "too old" samples; strange ratesLogs; node_timex_offset_secondsNTP/chrony on every host
12Expensive queryPrometheus CPU pegged, everyone's dashboards slowqueries.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.

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.

On this page