RousselTMLEARNING

Observability

Alertmanager high availability and operations

Set up a highly available Alertmanager cluster (gossip), configure Prometheus for all members, monitor the alerting chain with a Watchdog and diagnose lost notifications.

1. Cluster mode #

No load balancer between Prometheus and Alertmanager.

Principle #

Alertmanager cluster
Members share silences and the notification log: only one sends.

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:9094

On 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 #

MetricUsage
alertmanager_notifications_failed_totalSending failures per integration
alertmanager_notification_latency_secondsSending delay
alertmanager_cluster_membersCluster size as seen by each member
prometheus_notifications_dropped_totalAlerts Prometheus could not forward
alertmanager_config_last_reload_successfulWas the last configuration reload successful?

3. Diagnosing #

« I did not receive the alert ».

Method #

  1. Is the rule firing in Prometheus (/alerts) or still pending?
  2. Could Prometheus reach Alertmanager (prometheus_notifications_errors_total)?
  3. Is the alert visible in Alertmanager? Is it silenced or inhibited?
  4. Which route did it take (amtool config routes test)?
  5. 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

Related articles

Alertmanager: role, architecture and lifecycle of an alert

What Alertmanager does between Prometheus and your teams: deduplication, grouping, routing, silences and inhi…

Writing good Prometheus alerting rules (and testing them)

Design useful alerts: alert on symptoms, choose for and thresholds, severity and team labels, annotations and…

Routing, grouping and receivers in Alertmanager

The Alertmanager routing tree: matchers, group_by, group_wait, group_interval, repeat_interval, continue, rec…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!