Overview
A monitoring system has an awkward property: it is the whistle-blower for every incident you have, and when it breaks there is no second whistle.
Architecturally this is the “who watches the watcher” problem. In practice it is far more dangerous than it sounds, because Prometheus-class systems mostly fail quietly: the process is up, the port is open, Grafana panels still refresh, and the curve is still that nice green line. Unless you go read logs or check timestamps, you cannot tell it has been dead for half an hour.
A production change taught me this the hard way. During a rolling restart, Prometheus could not mount its PVC. The Pod would not start, and it did not error out either — the whole alerting path went silent with it. After traffic recovered we went through the change log and found that for two hours not a single alert had reached the on-call channel, including the ones that should have fired because of the very disruption we were causing. We were not being protected by monitoring; we were just lucky.
This article takes that incident apart and covers three things:
- The six places in the alerting path that break silently, and which metric reveals each one;
- Why “configure an alert for Prometheus inside Prometheus” is a logical dead end;
- How to build the three-tier heartbeat backstop, in what order, and the specific traps I hit.
Every PromQL and YAML snippet below can be pasted straight into a repo. Metric names follow Prometheus 2.x; I flag the places where versions differ.
The incident: every link assumed someone else was covering it
Let me reconstruct the timeline first. Everything that follows is derived from this scenario.
| Time | What happened | What monitoring showed |
|---|---|---|
| 02:10 | Node maintenance; the Prometheus Pod was evicted | Nothing abnormal. Panels froze at 02:09 |
| 02:11 | New node slowly pulled images and mounted a 500GB PVC | No alert (up is scraped by Prometheus itself; if it is not running, there is no up) |
| 02:14 | Alertmanager was evicted in the same batch | No alert |
| 02:20 | API error rate reached 7% and stayed there for 40 minutes | Panel showed 0.1%, because it was querying data from two hours earlier |
| 03:05 | The on-call engineer thought “it’s oddly quiet today” and opened the dashboard manually | Dashboard looked normal; concluded everything was fine |
| 04:12 | Customer support forwarded a user complaint | We discovered monitoring was down |
The root cause was a slow PVC mount. Nothing interesting about it. What chilled me was the stretch from 02:20 to 04:12: the data was stale, and no interface anywhere carried any marker of staleness.
There is a Grafana behavior worth knowing. When the query range is “last 6 hours” and the datasource only has points from two hours ago, Grafana draws those points as a flat line and leaves the right edge blank. Skim it and you see “steady”, not “no data”. Add time zones, zoom levels and split panels, and the blank region is easy to miss.
So the first lesson: “the dashboard is green” does not imply “the system is healthy”. That only holds once you have confirmed the data is fresh.
Six blind spots: where the pipeline breaks quietly
A complete alerting path looks like this:
business metrics → exporter → Prometheus scrape → rule evaluation → notification queue
→ Alertmanager dedup/grouping/routing → inhibition & silences → integration (chat/SMS/phone)
Break any link and the result is identical: nothing on your phone. The difference is that some breakpoints are visible in metrics and some are not.
| # | Blind spot | Symptom | Who can detect it |
|---|---|---|---|
| 1 | Rule evaluation skipped | Rule group too slow, evaluation skipped, alert never computed | Metrics from the same instance (if alive) |
| 2 | Notification queue overflow | Alert computed but never sent; queue full, dropped | Same instance metrics |
| 3 | Alertmanager delivery failure | Alert received but no notification (timeout, template error, route mismatch) | Alertmanager metrics + logs |
| 4 | Alertmanager cluster split | Gossip broken between replicas, duplicated notifications or inconsistent state | Cluster metrics |
| 5 | for: state lost / stale data | Long for never fires; panels show old data | Nobody, unless you build it |
| 6 | Inhibition and silences turning on you | One wide matcher silences the entire site | Requires auditing; invisible by default |
Blind spots 1 through 4 share one precondition: Prometheus itself is still alive and can still reach Alertmanager. Blind spots 5 and 6 are nastier because the pipeline is technically working — the problem is semantic. That is the entire reason a real backstop has to come from outside the path.
Blind spot 1: rules never run, and everyone assumes you are covered
Prometheus evaluates rules sequentially within a group and in parallel across groups. So what happens when a group holds 300 rules, one evaluation takes 70 seconds, and the evaluation interval is 60 seconds?
Subsequent evaluations are skipped. Not queued — skipped. Prometheus does not treat this as an error; it just increments a counter.
Two metrics tell the story:
# Evaluation duration relative to the rule group interval
prometheus_rule_group_last_duration_seconds
/ on(job, rule_group) group_left()
prometheus_rule_group_interval_seconds
# Number of skipped evaluations
rate(prometheus_rule_group_iterations_missed_total[10m])
My rule of thumb: a single group’s evaluation should not exceed 50% of its interval. Past that, split the group. Do not wait until evaluations are being dropped.
Here are the alert rules:
groups:
- name: meta-rule-eval
interval: 30s
rules:
- alert: RuleGroupEvaluationTooSlow
expr: |
prometheus_rule_group_last_duration_seconds
/ on(job, rule_group) group_left()
prometheus_rule_group_interval_seconds > 0.5
for: 10m
labels:
severity: warning
team: observability
annotations:
summary: "Rule group {{ $labels.rule_group }} takes more than 50% of its interval to evaluate"
runbook: "Split the rule group, or precompute the heavy query as a recording rule"
- alert: RuleEvaluationSkipped
expr: increase(prometheus_rule_group_iterations_missed_total[10m]) > 0
for: 5m
labels:
severity: critical
team: observability
annotations:
summary: "Rule group {{ $labels.rule_group }} skipped evaluations; alerts may already be missing"
There is a subtler variant: a broken rule file. When hot reload fails, Prometheus keeps running the old rules. It does not exit and does not alert; all you get is a zero on prometheus_config_last_reload_successful.
prometheus_config_last_reload_successful == 0
This one belongs in self-monitoring. I have seen a case where someone edited alert rules, committed, CI passed, the reload endpoint returned 200 — but the live config was still the old one because the validation failure had been swallowed. Three days later we noticed none of the new alerts had ever fired.
Why CI passing is not enough: CI runs
promtool check rules, which validates syntax. A live reload can still fail on permissions, paths, or external template variables. You need both.
If you run a managed service (AMP, Mimir and friends), also watch rule group health. AWS’s AMP documentation gives a practical checklist: a group whose health is err with a non-empty lastError means the expression itself is failing, while a rising RuleGroupIterationsMissed counter means evaluation cannot keep up (AMP troubleshooting rule evaluations). Self-hosted Prometheus exposes something similar through non-exported health state; if you cannot reach it, fall back to prometheus_rule_evaluation_failures_total.
Blind spot 2: computed, but never sent
Between Prometheus and Alertmanager sits an in-memory queue, default capacity 10000 alerts. If Alertmanager is unreachable, slow, or stuck in a batch conflict, the queue fills up — and when it is full, the behavior is to drop:
# Drop counter. Any increase is an incident
increase(prometheus_notifications_dropped_total[5m]) > 0
# Queue watermark
prometheus_notifications_queue_length
/ prometheus_notifications_queue_capacity > 0.8
Note that prometheus_notifications_dropped_total is a Prometheus-side metric. It works while Prometheus is alive. If Prometheus itself dies, the metric disappears along with it.
Size the queue for your actual alert volume instead of keeping the default. A cluster with 3000 instances can produce thousands of up == 0 alerts during a single network partition, and the default 10000 drains in minutes.
# prometheus startup flags
- --alertmanager.notification-queue-capacity=30000
- --alertmanager.timeout=10s
That said, reducing noise matters more than raising capacity. Batch failures like up == 0 should be collapsed into a single “this datacenter is unreachable” alert at the scrape layer, rather than one alert per instance. I covered the collapse patterns in Related: Monitoring Data Governance: From Metrics Explosion to Precision Observability, so I will not repeat them here.
Blind spot 3: Alertmanager received it, but nothing went out
This link is the worst offender because it hides four independent traps.
Trap 1: group_interval doubles as the send timeout.
The official configuration docs state it plainly: “group_interval also sets the context timeout for the notification pipeline for each send. So if sending a notification takes longer than the group_interval, the notification will get canceled.” (Alertmanager configuration)
In other words: set group_interval to 1 minute for speed, and if your webhook backend takes 80 seconds to respond under peak load, that notification is cancelled — not retried. The symptom is intermittent delivery: sometimes it arrives, sometimes it does not.
My advice: never set group_interval below 2 minutes, and make the webhook backend accept asynchronously — return 202 immediately and process out of band.
While we are here, look at the receiver config; both the template guard and async acceptance live in it:
receivers:
- name: default-im
webhook_configs:
- url: 'https://im-gateway.internal/hooks/alert'
send_resolved: true
max_alerts: 40 # cap at 40 alerts per message, split beyond that
- name: heartbeat
webhook_configs:
- url: 'https://heartbeat.example.internal:9099/ping'
send_resolved: false # heartbeats have no "resolved" semantics
templates:
- '/etc/alertmanager/templates/*.tmpl'
max_alerts is an easy knob to overlook. The default 0 means unlimited, so a partition event stuffs hundreds of alerts into one message, the receiver times out parsing it, and you land exactly on the group_interval cancel path — the notification is simply gone. Set it around 40 and let Alertmanager split the payload.
Trap 2: silences have no expiry audit.
A single {severity=~".+"} silence can swallow every alert you have, and the UI will still look clean — no red dots, no unread count. Silences do expire, but “disappears on schedule” means it may well still be active during exactly the window you needed it most.
Audit approach: periodically pull GET /api/v2/silences and list the state=active ones whose matchers are broad.
import json, urllib.request, datetime
def wide_silences(am_url):
with urllib.request.urlopen(f"{am_url}/api/v2/silences") as r:
data = json.load(r)
out = []
for s in data:
if s["status"]["state"] != "active":
continue
# Treat regex-only or severity/alertname/team-only matchers as broad
loose = [m for m in s["matchers"]
if m["isRegex"] or m["name"] in ("severity", "alertname", "team")]
if len(loose) >= 2 or any(m["isRegex"] and m["value"] in (".+", ".*", ".+?") for m in s["matchers"]):
out.append({
"id": s["id"][:8],
"createdBy": s["createdBy"],
"comment": s["comment"][:60],
"endsAt": s["endsAt"],
"matchers": [(m["name"], m["value"]) for m in s["matchers"]],
})
return out
Run it daily and push the result to the on-call channel. If a broad silence has been active for more than four hours, require someone to add a reason.
Trap 3: config reload fails and Alertmanager keeps the old config.
Same problem as Prometheus, but worse — the stale route may point at a chat group that was disbanded months ago.
alertmanager_config_last_reload_successful == 0
Trap 4: template rendering errors kill the notification entirely.
Alertmanager renders templates with Go’s text/template. {{ .Labels.runbook_url }} returns an empty string when the label is missing, which is harmless. But {{ toUpper .Labels.xxx }} on a nil, or calling index on a non-map variable, returns an execution error. The consequence is that the entire notification is skipped, and Alertmanager waits for the next repeat_interval — four hours by default.
One team catalogued these failure modes and noted that in many versions a template render failure is neither counted in alertmanager_notifications_failed_total nor given its own counter; all you get is a warn-level log line (Perun Engineering: Alertmanager in production). My own checks agree: you debug this by reading logs.
So add this to your inspection script:
# Look for template rendering failures in the last hour
kubectl logs -l app=alertmanager --since=1h \
| grep -Ei 'template|expand|executing' | tail -20
I recommend guarding every template so that render errors cannot happen in the first place:
{{ with .Labels.runbook_url }}{{ . | toUpper }}{{ else }}NO_RUNBOOK{{ end }}
Blind spot 4: the Alertmanager cluster splits
Three Alertmanager replicas share a notification log over gossip, which is how they deduplicate. Three things to know.
First: never load-balance between Prometheus and Alertmanager. The official docs are blunt: “It’s important not to load balance traffic between Prometheus and its Alertmanagers, but instead, point Prometheus to a list of all Alertmanagers.” (Alertmanager docs)
The reason is simple. Deduplication relies on every replica receiving the same alert and comparing notification logs. Put an LB in front and each alert lands on exactly one replica: deduplication stops working, and if that replica dies the alert is gone with it.
# prometheus.yml
alerting:
alertmanagers:
- static_configs:
- targets:
- am-0.monitoring:9093
- am-1.monitoring:9093
- am-2.monitoring:9093
Second: during a partition the behavior is fail-open, not fail-safe. The official HA docs describe it: after a split, each partition elects its own position 0, each sends the notification, and the result is a duplicate rather than a loss. The design intent is “better duplicated than missed” (Alertmanager High Availability).
I agree with that trade-off completely, but it has a side effect: the on-call engineer receives two identical phone calls, starts doubting the monitoring system, and begins hand-writing inhibition rules. That makes things worse. Accept the duplicates; do not add a second dedup layer on top.
Third: clock skew breaks gossip deduplication. The same doc reminds you to keep NTP healthy. This one bites for real: a container drifting tens of seconds produces notification-log timestamps that do not line up, and the dedup decision goes wrong.
abs(node_timex_offset_seconds) > 0.5
Cluster health looks like this:
alertmanager_cluster_members < 3
Note the paradox: this alert must itself traverse Alertmanager to be delivered. If the cluster has split down to one replica and that replica is unusable, it will never fire. Treat it as an internal hint, never as a backstop.
Blind spot 5: for: state is not persistent, and panels lie
This is, in my view, the highest-value blind spot because almost nobody handles it deliberately.
Prometheus alert state lives in memory. After a restart, every pending state resets. Write an alert with for: 30m, and if that Prometheus restarts every 20 minutes due to OOM, the alert never reaches firing. The rule is correct, the pipeline is healthy, and it simply never rings.
That scenario is not exotic. Prometheus memory grows with series count, the node gets tight on memory, and kubelet starts killing it repeatedly. You can see kube_pod_container_status_restarts_total climbing, but nobody connects it to “why did my alert never fire”.
# Abnormal restart rate
increase(kube_pod_container_status_restarts_total{container="prometheus"}[1h]) > 1
Two countermeasures.
First, stop overusing long for. for: 30m means you tolerate 30 minutes of continuous failure before anyone is notified, while plenty of SLO-grade problems deserve attention after five. The legitimate use of a long for is anti-flapping, and for that, keep_firing_for (Prometheus 2.42+) beats stretching for:
- alert: ApiErrorRateHigh
expr: |
sum(rate(http_requests_total{code=~"5.."}[5m])) by (service)
/ sum(rate(http_requests_total[5m])) by (service) > 0.02
for: 5m
keep_firing_for: 10m # do not resolve instantly when the series briefly disappears
Second, document “alert state is lost on restart” as a known risk in the runbook, and run two Prometheus replicas scraping the same targets and pointing at the same Alertmanager set. When replica A restarts, replica B still holds its own pending state.
The lying panel problem: to judge data freshness, do not look at the curve — compute a timestamp delta.
# Seconds since the last successful scrape of a job
time() - max(timestamp(up{job="api-gateway"})) > 180
timestamp() returns the sample’s own timestamp in seconds, which is more direct than time() - last_over_time(...). Turn it into an alert:
- alert: MetricsDataStale
expr: time() - max(timestamp(up{job="api-gateway"})) > 180
for: 2m
labels:
severity: critical
team: observability
annotations:
summary: "No new samples for api-gateway in 3 minutes; the panel may not show current state"
Note this only works while Prometheus is alive. It detects “some target died”, not “Prometheus died”.
Blind spot 6: inhibition swallows the recovery too
Inhibition is well-intentioned: when a whole datacenter is unreachable, do not let a hundred services each page. But a loosely written inhibition rule will suppress resolved notifications as well.
The consequence is a recovered incident with a ticket still open and nobody aware they can close it. That does not cause outages, but it steadily erodes trust — the team concludes that monitoring “says things that are not true”.
My rule: inhibit warning only, never critical; and require a compound constraint such as same cluster plus same service, never alertname alone.
inhibit_rules:
- source_matchers: ['alertname="ClusterUnreachable"']
target_matchers: ['severity="warning"']
equal: ['cluster']
# critical is never inhibited; duplicates are preferable to silence
A three-tier heartbeat: terminate the recursion outside the monitoring system
After those six blind spots, one structural fact should be obvious: alerts configured inside Prometheus can only cover the half of reality where Prometheus is alive.
The other half has to come from outside. I split it into three tiers, ordered by distance from the system under watch.
| Tier | Mechanism | Failures covered | Build cost |
|---|---|---|---|
| 1 | Watchdog rule + dedicated receiver | Rule evaluation, notification queue, routing | 30 minutes |
| 2 | External heartbeat service (Dead Man’s Snitch style) | Alertmanager down, network broken, integration broken | Half a day |
| 3 | Cross-instance monitoring + independent probing | Prometheus unavailable as a whole | 1-2 days |
Tier 1: the Watchdog rule, where the routing is the hard part
The idea is almost comically simple: write an alert that is always true and let it fire forever. When it stops arriving, the pipeline is broken.
kube-prometheus-stack ships this rule as Watchdog, with the expression vector(1) (kube-prometheus-stack Watchdog). If you self-host, add it yourself:
groups:
- name: meta-heartbeat
interval: 30s
rules:
- alert: Watchdog
expr: vector(1)
labels:
severity: none
team: observability
annotations:
summary: "Alert pipeline heartbeat. Firing permanently is normal; stopping is the incident"
The important part is the Alertmanager route. The default repeat_interval is four hours, so the heartbeat must be far denser than your external detection window:
route:
receiver: default-im
group_by: ['alertname', 'cluster']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers: ['alertname="Watchdog"']
receiver: heartbeat
group_wait: 0s
group_interval: 1m
repeat_interval: 5m # one heartbeat every 5 minutes
receiver: heartbeat points at a channel that bothers nobody — the external heartbeat service’s webhook. Never point it at the on-call chat group, or you will get a “heartbeat” every five minutes and within two days somebody will silence it, taking your backstop with it.
The most common failure here is not a config mistake — it is somebody turning Watchdog off because it is noisy. The kube-prometheus-stack docs specifically warn against this: give it a dedicated receiver nobody watches, rather than deleting the rule.
Tier 2: an external heartbeat service, with the window computed properly
Tier 1 only proves that “Prometheus → Alertmanager → this receiver” works. If Alertmanager itself is down, or that webhook’s network path is broken, tier 1 says nothing — because the absence of a heartbeat is the signal, and you need a third party to decide that something which should have arrived did not.
That is what services like Dead Man’s Snitch do: they wait for you, and when you fail to check in, they call you. PagerDuty’s Dead Man’s Snitch integration and healthchecks.io both work; if you would rather not buy it, a twenty-line service will do.
A self-hosted version (adequate, running outside the monitoring cluster):
# heartbeat.py -- deploy on a host outside the monitoring namespace
import time, json, os
from http.server import BaseHTTPRequestHandler, HTTPServer
STATE = "/var/lib/heartbeat/last_seen.json"
THRESHOLD = 15 * 60 # page if nothing arrives for 15 minutes
class H(BaseHTTPRequestHandler):
def do_POST(self):
n = int(self.headers.get("Content-Length", 0))
body = self.rfile.read(n).decode()
with open(STATE, "w") as f:
json.dump({"ts": time.time(), "n": len(json.loads(body).get("alerts", []))}, f)
self.send_response(200); self.end_headers()
def log_message(self, *a): pass # heartbeat logs are worthless, keep them off disk
def check_loop(notify):
while True:
try:
last = json.load(open(STATE))["ts"]
except Exception:
last = 0
gap = time.time() - last
if gap > THRESHOLD:
notify(f"Alert pipeline heartbeat missing for {int(gap/60)} minutes, last seen {time.ctime(last)}")
time.sleep(600) # avoid paging on every loop
time.sleep(30)
if __name__ == "__main__":
# notify should use SMS/voice API -- a completely different channel from chat
from threading import Thread
Thread(target=check_loop, args=(lambda m: print(m),), daemon=True).start()
HTTPServer(("0.0.0.0", 9099), H).serve_forever()
How to pick the window: threshold ≥ heartbeat interval × 3. A five-minute heartbeat pairs with a fifteen-minute threshold. Red Hat’s OpenShift documentation uses the same order of magnitude — the dead man’s switch repeats every five minutes, and the external service pages after fifteen minutes of silence (OpenShift Prometheus Cluster Monitoring).
Too small and you get false positives: an Alertmanager restart takes three minutes, the heartbeat stops for three minutes, and a five-minute threshold pages you. Too large and it is pointless: a two-hour threshold means you still wait two hours at 3 AM.
This service’s paging channel must be physically separate — not the same chat webhook, not the same machine. GitLab’s runbook is candid about their own predicament: if PagerDuty is down they have no backup urgent path and rely on someone happening to notice Slack (GitLab Runbooks: monitoring). That is the state of many teams, not a design.
Tier 3: cross-monitoring and independent probing
Tier 2 solves “notifications cannot get out”. It does not solve “Prometheus is entirely unavailable”. That requires someone looking in from outside.
Cross-monitoring: A scrapes B’s /metrics, B scrapes A’s /metrics, and each brings the other’s up and key self-monitoring metrics into its own rules.
# prometheus-a scrape config: itself plus its peer
scrape_configs:
- job_name: prometheus-self
static_configs:
- targets: ['localhost:9090']
- job_name: prometheus-peer
static_configs:
- targets: ['prometheus-b.monitoring:9090']
# On A: decide whether B is alive
- alert: PeerPrometheusUnreachable
expr: up{job="prometheus-peer"} == 0
for: 2m
labels:
severity: critical
team: observability
annotations:
summary: "Peer Prometheus unreachable; this instance may now be the only data source"
Cross-monitoring has one precondition: the two instances must not share a failure domain. Same node, same rack, same availability zone, and one maintenance window takes both down — which is exactly what happened in my incident, where Prometheus and Alertmanager were evicted in the same batch. At minimum go cross-AZ; ideally cross-datacenter.
Independent probing: from the public internet or another cloud, poll critical business endpoints and monitoring endpoints on a schedule. It is the crudest and most reliable layer, because its entire decision logic is: HTTP did not return what I expected, so I call you. GitLab treats this as the last line of defense (Pingdom), and I think that framing is right — it is not elegant, but it works when every other layer has failed.
Drills: this backstop needs to be unplugged periodically
Configuring it is not the end. I have seen plenty of teams wire up Watchdog, never verify it for two years, and discover on the first real incident that the receiver had long since been pointed at a disbanded chat group. A backstop that is never exercised does not exist.
We run a quarterly “pull the plug” drill with four scenarios, each lasting ten minutes:
| Scenario | Action | Expected result | Common failure |
|---|---|---|---|
| Drop a rule | Delete a rule group file and reload | Heartbeat continues; a rule-count check notices the gap | No rule-count check exists |
| Stop Prometheus | Scale the main instance to 0 | Cross-monitoring alerts within 2 minutes, external heartbeat within 15 | Threshold too long; you learn after 30 minutes |
| Stop Alertmanager | Stop all three replicas | Tier 2 heartbeat hits the SMS channel | The heartbeat service shares the same Alertmanager and goes silent too |
| Create a wide silence | Add {severity=~".+"} for an hour, then run the audit | Audit lists the silence and notifies | The audit job did not run, and nobody cared |
Two rules for drills:
First, use only the real channel; do not prefix messages with “drill”. The moment “this is a drill” is allowed, people learn to ignore it and the exercise becomes theater. If you need to distinguish, agree on a time window (“19:00-19:30 is the drill window”) instead of changing the message.
Second, every drill must carry its own recovery step, written on the drill ticket. Forgetting to scale a replica back up is the most common self-inflicted wound in this kind of exercise.
# Scenario two: stop a main Prometheus replica, watch cross-monitoring and the external heartbeat
kubectl -n monitoring scale statefulset prometheus-main --replicas=0
watch -n 5 'kubectl -n monitoring get pod -l app=prometheus'
# Recovery (this line must appear on the drill ticket)
kubectl -n monitoring scale statefulset prometheus-main --replicas=2
Deploy the heartbeat service with systemd rather than in Kubernetes. Its entire value is having no shared dependency with the monitoring cluster:
# /etc/systemd/system/heartbeat.service
[Unit]
Description=Alert pipeline heartbeat watchdog
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/python3 /opt/heartbeat/heartbeat.py
Restart=always
RestartSec=5
StandardOutput=append:/var/log/heartbeat.log
[Install]
WantedBy=multi-user.target
Where to put the machine is an easily missed detail: not in the same cluster, not on the same network path as monitoring, and ideally not even the same cloud provider. It sounds like over-engineering, but this box plays the role of the last remaining channel — when every other layer is gone, it is the only thing still standing.
For how to group, route and inhibit alerts in the first place, I broke it down in Related: Alertmanager Alert Routing and Silencing Strategies; the four-layer defense that cut fault localization time is in Related: MTTR from 40 minutes to 8.
The self-monitoring metric checklist
Here are the metrics above consolidated into one table you can build dashboards and rule groups against:
| Layer | Metric | Suggested threshold | Notes |
|---|---|---|---|
| Scraping | up | == 0 for 2m | Per-target availability |
| Scraping | scrape_duration_seconds / prometheus_target_interval_length_seconds | Approaching the scrape interval | Scraping is falling behind |
| Scraping | prometheus_target_scrapes_exceeded_sample_limit_total | Any increase | Samples truncated by the per-scrape limit |
| Storage | prometheus_tsdb_head_series | Depends on capacity | Active series, the main memory driver |
| Storage | prometheus_tsdb_compactions_failed_total | Any increase | Compaction failing: disk or IO |
| Storage | prometheus_tsdb_wal_corruptions_total | Any increase | WAL corruption, trouble is imminent |
| Rules | prometheus_rule_group_last_duration_seconds | > interval × 0.5 | Rule group too slow |
| Rules | increase(prometheus_rule_group_iterations_missed_total[10m]) | > 0 | Evaluations skipped, alerts already missed |
| Rules | prometheus_config_last_reload_successful | == 0 | Rules never took effect, old config still running |
| Notify | prometheus_notifications_queue_length | > capacity × 0.8 | Queue watermark |
| Notify | increase(prometheus_notifications_dropped_total[5m]) | > 0 | Alerts dropped |
| AM config | alertmanager_config_last_reload_successful | == 0 | Routes never took effect |
| AM delivery | rate(alertmanager_notifications_failed_total[5m]) | > 0 | Integration send failures |
| AM cluster | alertmanager_cluster_members | < replica count | Gossip broken |
| AM silences | Silence API audit | Broad matcher > 4h | Needs a script; metrics cannot see it |
| Freshness | time() - max(timestamp(up{job=~".+"})) | > 3× scrape interval | Panels may be showing old data |
The minimal config for the self-monitoring instance
Turning the checklist into reality starts with deciding which Prometheus watches these metrics. My answer: a dedicated instance, not self-monitoring inside the main cluster.
# prometheus-meta.yml -- does one job: watching the main cluster and the alert pipeline
global:
scrape_interval: 30s
evaluation_interval: 30s
external_labels:
cluster: meta
scrape_configs:
- job_name: meta-self
static_configs:
- targets: ['localhost:9090']
# federate only self-monitoring series, never business metrics
- job_name: prometheus-main
metrics_path: /federate
params:
'match[]':
- '{__name__=~"prometheus_.*"}'
- '{__name__=~"alertmanager_.*"}'
- 'up{job=~".+"}'
static_configs:
- targets:
- prometheus-main-0.monitoring:9090
- prometheus-main-1.monitoring:9090
- job_name: alertmanager
static_configs:
- targets:
- am-0.monitoring:9093
- am-1.monitoring:9093
- am-2.monitoring:9093
rule_files:
- /etc/prometheus/rules/meta-*.yml
A few parameter choices explained:
- Use
/federateinstead of plain scraping.match[]selects only self-monitoring series andup, dropping volume from millions to tens of thousands of series. This instance will never be OOM-killed for memory — and it exists precisely to catch OOM kills. - 15-30 days of retention is plenty. It is not for historical queries. When something breaks, people want to know when it broke, not what the curve looked like six months ago.
- Give it a dedicated resource quota. I allocate 2 CPU / 4 GB with
requestsequal tolimits, so it cannot lose CPU to the main cluster and get evicted itself. - Two replicas, cross-AZ. A single replica is acceptable since it alerts rather than serves queries, but cross-AZ costs almost nothing and removes a failure domain.
Rows three through nine in that table only cover the “Prometheus is alive” scenario. Every time someone tells me “our monitoring is comprehensive”, I ask one question first: is Watchdog still firing right now? If they cannot answer, it is not there.
Rollout order: outside first, inside second
If you can only do one thing, do the tier-2 heartbeat. If you have time, follow this order:
- Week one: external heartbeat plus the Watchdog route. Half an hour for the rule, half a day for the external service. After this step you go from “completely blind” to “at least I know when I go blind”. Best return on effort of anything here, by a wide margin.
- Week two: Alertmanager config hygiene. No load balancing, cluster member count, reload success flag, silence audit script. These remove most of the “the alert never arrived” mystery.
- Week three: rule and queue metrics. Split oversized rule groups, alert on skipped evaluations, watch the queue watermark. Add
prometheus_config_last_reload_successfulwhile you are at it — it costs nothing. - Week four: data freshness and panel hygiene. Stale-data alerts, plus a timestamp readout on Grafana panels. Make “no data” look like “no data” instead of “steady”.
A few traps I already paid for, so you do not have to:
Trap A: routing Watchdog to the on-call group. Every drill someone asks “what is this Watchdog thing”, and then someone silences it. Use a dedicated receiver.
Trap B: setting the external heartbeat threshold to five minutes. One Alertmanager rolling upgrade produces one false page, and after three weeks everyone ignores it. Go with fifteen.
Trap C: self-monitoring on the same Prometheus as production monitoring. The main instance runs out of memory and the self-monitoring metrics vanish with it. Give self-monitoring its own small instance (1-2 replicas, 15-day retention, a few dozen targets) instead of economizing. In my setup that instance does exactly one job: watching the main cluster and the alert pipeline, with a data volume small enough that it cannot OOM.
Trap D: believing up == 0 is a backstop. up is generated by Prometheus itself. When it dies, up ceases to exist and the rule never evaluates. This misunderstanding is extremely common — I have hit it in three separate reviews, each time with someone citing up as evidence that “monitoring is alive”.
Trap E: treating silences as a temporary tool. Auto-expiry sounds safe, but “expiry” often lands exactly when you wanted the silence to still be in place. My rules: a silence must have an end time, a reason, and a second approver if it exceeds four hours.
One last point about attitude. Self-monitoring produces no business value on a normal day: after you finish, nothing happens — and that is exactly what it should look like. Its value only shows on the worst day, and that day will come. The line I used to get this funded was: “right now our fire alarm is powered by the fire alarm system itself.” That landed with the product owner in one sentence, which explaining SLOs never did.
Summary
A monitoring system’s reliability cannot be attested by the monitoring system itself. That is the one central claim here; everything else is a corollary.
Concretely:
- Of the six blind spots, four — skipped rule evaluation, notification queue overflow, Alertmanager delivery failure, and cluster splits — can be caught with self-monitoring metrics while Prometheus is alive. The other two, lost
for:state and stale data, require purpose-built detection. - The three-tier heartbeat works from the inside out: Watchdog proves the pipeline is connected, the external heartbeat service proves that “what should have arrived did arrive”, and cross-monitoring plus probing prove that “the monitoring system as a whole is alive”. No single tier covers everything; every missing tier is a corresponding black hole.
- The rollout order is counterintuitive: build the outermost layer (external heartbeat) first, then the inner self-monitoring. Inner self-monitoring only covers the “still alive” case, while incidents tend to happen in the “already dead” case.
- Two must-check items: never load-balance between Prometheus and Alertmanager, and remember that
for:state is not persisted — longforalerts never fire on an instance that keeps restarting.
The first thing we did after that incident was not adding alerts; it was wiring the external heartbeat service to an SMS channel from a completely different vendor than our chat integration. Two weeks later it actually fired — an Alertmanager config change had routed every alert to an empty receiver. Without that SMS, we would have learned about it the next morning from users yelling at us.
An alerting path is a chain, and a chain is only as strong as its weakest link. The weakest link is usually the one you have never tested.
References & Acknowledgments
This article draws on the following sources. Thanks to their authors:
- Alertmanager | Prometheus — Official Prometheus documentation: grouping, inhibition, silences, high availability, and the explicit instruction never to load-balance Alertmanager traffic
- Configuration | Prometheus Alertmanager — Official configuration reference:
group_wait/group_interval/repeat_intervalsemantics, andgroup_intervalacting as the notification send timeout - High Availability | Prometheus Alertmanager — Official HA documentation: fail-open behavior during partitions, causes of duplicate notifications, and the impact of clock skew
- GitLab Runbooks: Monitoring — GitLab SRE’s meta-monitoring practice: cross-shard monitoring, SnitchHeartBeat, alerting failure modes, and the role of external black-box probing
- Chapter 5. Prometheus Cluster Monitoring | Red Hat OpenShift — DeadMansSwitch implementation and the 5-minute repeat / 15-minute threshold window design
- Troubleshoot rule evaluations | Amazon Managed Service for Prometheus — Skipped rule group evaluations (RuleGroupIterationsMissed), rule health troubleshooting, and advice to split rule groups
- Alertmanager in production: five failure patterns — Perun Engineering on five production failure patterns in Alertmanager, including notifications silently skipped on template render errors
- Alertmanager: Watchdog & External Alertmanager | kube-prometheus-stack — Default behavior of the Watchdog rule in kube-prometheus-stack and why you should not delete it
Thanks to the Prometheus community for writing these obscure failure semantics into the documentation at all, and to GitLab and Red Hat for publishing their production backstop designs. Knowledge that is worthless on a normal day and life-saving on the bad one does not get shared often.