Prometheus Alertmanager Repeat Interval Notification Spam Fix
In this tutorial, you'll learn about Prometheus Alertmanager Repeat Interval Notification Spam Fix. We cover key concepts, practical examples, and best practices.
Your Alertmanager sends the same alert notification every few minutes — a HighCPUUsage alert that has been firing for hours generates hundreds of Slack messages. The repeat_interval is too short, causing notification fatigue and alert dismissal.
The Problem
route:
receiver: slack-notifications
repeat_interval: 1m # Resends notification every minute!
One alert firing for 1 hour generates 60 Slack messages. The team mutes the channel or ignores alerts entirely.
Step-by-Step Fix
1. Set reasonable repeat intervals
route:
receiver: default
group_wait: 30s
group_interval: 5m
repeat_interval: 4h # Default — every 4 hours
2. Different intervals per severity
route:
receiver: default
group_by: ['alertname', 'severity']
repeat_interval: 8h # Default for warnings
routes:
- match:
severity: critical
receiver: pagerduty
repeat_interval: 1h # Critical: repeat every hour
group_interval: 1m
- match:
severity: info
receiver: slack-info
repeat_interval: 24h # Info: repeat once daily
group_interval: 30m
3. Acknowledge alerts to stop repeats
# Use Alertmanager's silence feature
# Or integrate with PagerDuty/Opsgenie acknowledgment
#
# When an alert is acknowledged in PagerDuty:
# - Create an Alertmanager silence matching the alert
# - Silence duration: 4h (expected resolution time)
# - On resolution: remove the silence
4. Use alert maintenance windows
# Create planned maintenance silences
# Alertmanager API: POST /api/v2/silences
{
"matchers": [
{"name": "alertname", "value": "HighCPUUsage", "isRegex": false},
{"name": "service", "value": "batch-job", "isRegex": false}
],
"startsAt": "2026-06-24T22:00:00Z",
"endsAt": "2026-06-25T06:00:00Z",
"comment": "Scheduled batch job — high CPU expected",
"createdBy": "admin"
}
5. Monitor notification volume
// Alertmanager notification rate by receiver
rate(alertmanager_notifications_total[5m])
// Failed notifications
rate(alertmanager_notifications_failed_total[5m])
// Alert count
ALERTS{alertstate="firing"}
Expected output:
Before: 60 notifications/hour (repeat_interval: 1m)
After: 1 notification/4 hours (repeat_interval: 4h)
Per day: 360 → 6 notifications
Prevention Tips
- Set
repeat_interval: 4has minimum for warning alerts - Use
1hfor critical,8h+for warning,24hfor info - Integrate with on-call tools that provide acknowledgment
- Use silences for planned maintenance
- Monitor notification volume to detect misconfigured intervals
Common Mistakes with alertmanager repeat
- Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists - Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
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