Skip to content

Prometheus Alertmanager Repeat Interval Notification Spam Fix

DodaTech Updated 2026-06-24 3 min read

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: 4h as minimum for warning alerts
  • Use 1h for critical, 8h+ for warning, 24h for 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

  1. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  2. Using head and tail instead of pattern matching, causing runtime errors on empty lists
  3. 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

### What's a good repeat_interval for production?

4 hours is the Prometheus default and a good starting point. For critical alerts (page), use 1 hour. For warning alerts (Slack), use 4-8 hours. For info alerts (dashboard), use 24 hours. Adjust based on your team's response time and alert volume.

How does repeat_interval interact with group_interval?

group_interval controls updates when NEW alerts fire in the same group. repeat_interval controls when the SAME alert notification is resent. These are independent — an alert firing for 10 hours repeats at repeat_interval intervals regardless of group_interval.

Do I still get notified when an alert resolves?

Yes, Alertmanager sends a RESOLVED notification when the alert condition clears. This happens regardless of repeat_interval. You get exactly one resolved notification per alert group.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro