Prometheus Alertmanager Grouping Not Sending Notifications Fix
In this tutorial, you'll learn about Prometheus Alertmanager Grouping Not Sending Notifications Fix. We cover key concepts, practical examples, and best practices.
Your Alertmanager sends a flurry of individual notifications for the same alert — every firing instance triggers a separate Slack message or email instead of being grouped. The group_by configuration is missing, so Alertmanager sends one notification per alert.
The Problem
route:
receiver: slack-notifications
group_by: [] # No grouping — every alert fires individually
When 10 pods all trigger HighCPUUsage, Alertmanager sends 10 separate Slack messages. The team is overwhelmed with notifications.
Step-by-Step Fix
1. Configure grouping by relevant labels
route:
receiver: slack-notifications
group_by: ['alertname', 'severity'] # Group by alert name and severity
group_wait: 30s # Wait 30s before sending (collects alerts)
group_interval: 5m # Wait 5m before sending new group updates
repeat_interval: 4h # Repeat notifications every 4h
2. Route-specific grouping for different receivers
route:
receiver: default
group_by: ['alertname', 'severity']
group_wait: 30s
group_interval: 5m
routes:
# Critical alerts: group by alertname
- match:
severity: critical
receiver: pagerduty-critical
group_by: ['alertname']
group_wait: 10s # Faster delivery for critical
repeat_interval: 1h
# Warning alerts: group by service
- match:
severity: warning
receiver: slack-warnings
group_by: ['alertname', 'service']
group_wait: 1m
repeat_interval: 8h
3. Understand notification timing
route:
group_by: ['alertname']
group_wait: 30s # How long to wait before sending first notification
# (collects alerts that fire within this window)
group_interval: 5m # How long to wait before sending updates
# (new alerts in the same group)
repeat_interval: 4h # How long to wait before resending
# (if alert is still firing)
4. Disable grouping for specific alerts
route:
receiver: default
group_by: ['alertname', 'service']
routes:
# Watchdog alert — send immediately, no grouping
- match:
alertname: Watchdog
receiver: watchdog
group_wait: 0s
group_interval: 1m
repeat_interval: 1m
Expected output:
Without grouping: 10 notifications (one per pod)
With grouping: 1 notification containing all 10 pods
Notification:
[FIRING:1] HighCPUUsage (critical)
Labels: {alertname="HighCPUUsage", severity="critical"}
Alerts:
- instance: web-1 (85.3%)
- instance: web-2 (91.2%)
- instance: web-3 (88.7%)
... (7 more)
Prevention Tips
- Always set
group_byto at least['alertname'] - Set
group_wait: 30-60sto collect burst of related alerts - Set
group_interval: 5mto prevent notification storms - Use
repeat_interval: 4h+to avoid notification fatigue - Override grouping for critical alerts with faster delivery
Common Mistakes with alertmanager group
- Non-exhaustive pattern matches that compile with warnings then crash at runtime
- Misunderstanding that
Stringis[Char]with poor performance for large text operations - Using
foldlinstead offoldl'causing stack overflow on large lists
These mistakes appear frequently in real-world PROMETHEUS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro