Alertmanager handles alerts sent by Prometheus. It receives alerts from Prometheus, deduplicates, groups, and routes them to the correct receiver (Slack, email, etc.) based on configured rules.
Description
Alertmanager is responsible for:
- Receiving alerts from Prometheus
- Grouping similar alerts
- Routing alerts to appropriate receivers
- Managing alert lifecycle (firing/resolved)
- Sending notifications to Slack
In this stack, Alertmanager:
- Receives alerts from Prometheus
- Routes alerts to different Slack channels
- Groups alerts by category
- Sends formatted notifications
The Alertmanager configuration defines:
- Global settings (timeouts, Slack webhook)
- Routing rules (which alerts go where)
- Receivers (notification targets like Slack channels)
- Inhibit rules (suppress lower severity alerts)
# =============================================================================# GLOBAL SETTINGS# =============================================================================global:resolve_timeout:5m# Wait 5 minutes before marking resolvedslack_api_url:"SLACK_WEBHOOK_URL_PLACEHOLDER"# Replaced at runtime# =============================================================================# ROUTING# =============================================================================route:group_by:["alertname","category"]# Group alerts by name and categorygroup_wait:30s# Wait 30s before sending first alertgroup_interval:5m# Wait 5m between sending groupsrepeat_interval:12h# Repeat unresolved alert every 12hreceiver:"slack-default"# Default receiverroutes:# Specific routing rules-match:category:db# Database alerts β #alerts-dbreceiver:"slack-db"-match:category:http# HTTP alerts β #alerts-httpreceiver:"slack-http"-match:category:latency# Latency alerts β #alerts-latencyreceiver:"slack-latency"-match:category:infrastructure# Infrastructure alerts β #alerts-infrareceiver:"slack-infra"# =============================================================================# RECEIVERS# =============================================================================receivers:-name:"slack-default"slack_configs:-channel:"#alerts"send_resolved:true# Send when alert resolves-name:"slack-db"slack_configs:-channel:"#alerts-db"send_resolved:true-name:"slack-http"slack_configs:-channel:"#alerts-http"send_resolved:true-name:"slack-latency"slack_configs:-channel:"#alerts-latency"send_resolved:true-name:"slack-infra"slack_configs:-channel:"#alerts-infra"send_resolved:true# =============================================================================# INHIBIT RULES# =============================================================================inhibit_rules:-source_match:severity:"critical"# If critical alert firestarget_match:severity:"warning"# Suppress warningequal:["alertname"]# Only if same alertname
1. Prometheus evaluates alert rules every 15s
β
βΌ
2. Alert condition met β Prometheus sends to Alertmanager
POST http://obs-alertmanager:9093/api/v1/alerts
β
βΌ
3. Alertmanager receives and:
a) Deduplicates (groups identical alerts)
b) Waits group_wait (30s) for more alerts
c) Sends to configured receiver
β
βΌ
4. Slack receives formatted notification
$curlhttp://localhost:9093/api/v1/alerts|jq
[{"labels":{"alertname":"DjangoDown",
"category":"http",
"severity":"critical"},
"annotations":{"summary":"Django is DOWN",
"description":"Django app has been unreachable for more than 10 seconds"},
"state":"firing",
"activeAt":"2026-03-15T10:30:00Z"}]
# Health checkcurl-fhttp://localhost:9093/healthy||echo"Alertmanager is down"# Check statuscurlhttp://localhost:9093/api/v1/status|jq
# Check alertscurlhttp://localhost:9093/api/v1/alerts|jq'length'