1. Cluster mode #
No load balancer between Prometheus and Alertmanager.
Principle #
Alertmanager instances form a cluster via gossip (port 9094) and share silences and the notification log. Each Prometheus must send its alerts to all members; they coordinate so that only one notification goes out (with a slight delay based on position in the cluster).
alertmanager --config.file=alertmanager.yml \
--cluster.listen-address=0.0.0.0:9094 \
--cluster.peer=alertmanager-1:9094 --cluster.peer=alertmanager-2:9094On the Prometheus side #
alerting:
alertmanagers:
- static_configs:
- targets: [alertmanager-1:9093, alertmanager-2:9093, alertmanager-3:9093]Common mistake: Never put a load balancer between Prometheus and Alertmanager: each instance must receive all alerts, otherwise deduplication no longer works.
2. Monitoring the alerting chain #
Who alerts when alerting goes down?
The Watchdog #
An always-active alert (vector(1)) is sent continuously to an external service (dead man's switch: healthchecks.io, Cronitor, PagerDuty heartbeat...). If notifications stop, the external service raises the alarm: Prometheus, Alertmanager or the network is down.
- alert: Watchdog
expr: vector(1)
labels: { severity: none }
annotations: { summary: "Alerte de contrôle : doit toujours être active" }Useful metrics #
| Metric | Usage |
|---|---|
alertmanager_notifications_failed_total | Sending failures per integration |
alertmanager_notification_latency_seconds | Sending delay |
alertmanager_cluster_members | Cluster size as seen by each member |
prometheus_notifications_dropped_total | Alerts Prometheus could not forward |
alertmanager_config_last_reload_successful | Was the last configuration reload successful? |
3. Diagnosing #
« I did not receive the alert ».
Method #
- Is the rule firing in Prometheus (
/alerts) or still pending? - Could Prometheus reach Alertmanager (
prometheus_notifications_errors_total)? - Is the alert visible in Alertmanager? Is it silenced or inhibited?
- Which route did it take (
amtool config routes test)? - Did sending fail (logs,
alertmanager_notifications_failed_total)?
amtool check-config alertmanager.yml # valider avant de déployer
curl -X POST localhost:9093/-/reload # recharger sans redémarrer
amtool config routes show # afficher l'arbre
amtool alert add alertname=Test severity=critical team=db \
--annotation=summary="Alerte de test" # injecter une alerte de test