Prompt
How do I dedupe repeated alerts before paging the on-call?
Latest observation
To dedupe repeated alerts before paging on-call, the usual goal is to group identical or highly similar alerts into one incident, then notify only when the incident is new, changes materially, or persists beyond a threshold.
Common approaches
1) Group by a stable fingerprint
Create a dedupe key from fields that identify “the same problem,” such as:
- alert name / rule ID
- service / app
- environment
- region
- host or cluster
- error type or dependency
Example fingerprint:
alert_name + service + environment + region
Avoid including noisy fields like:
- timestamp
- request ID
- pod name if it changes often
- sequence number
- ephemeral container ID
2) Use an alert manager / incident router
Tools like Alertmanager, PagerDuty, Opsgenie, VictorOps, Datadog, New Relic, etc. usually support:
- deduplication
- grouping
- suppression
- notification routing
- escalation policies
For example, in Alertmanager you can group by labels such as:
group_by: ['alertname', 'service', 'env']
This prevents each repeated firing from paging separately.
3) Add a suppression window
Only page if the same alert repeats after a cooldown, or if it stays active long enough.
Typical patterns:
- page on first occurrence
- suppress repeats for 10–30 minutes
- re-page only if it clears and returns
- or page only after N occurrences in M minutes
4) Page only on “actionable” severity
Use severity levels:
- warning → ticket / dashboard / Slack
- critical → page
This reduces duplicate paging when the same underlying issue causes many low-level alerts.
5) Aggregate before alerting
Instead of alerting on every instance, aggregate metrics:
- error rate over a service
- percentage of unhealthy nodes
- count of failures over a window
Example:
- alert if
5xx rate > 5% for 5 minutes - not if each failed request triggers its own alert
6) Correlate child alerts into a parent incident
If one root cause causes many symptoms:
- create a parent alert/incident
- suppress downstream symptom alerts
- attach them as context instead of separate pages
7) Add flapping protection
If alerts rapidly clear and re-fire:
- require the condition to persist for a duration
- use hysteresis
- use
for:in Prometheus-like systems - use hold-down timers
Example:
for: 5m
This means the alert must remain true for 5 minutes before firing.
Practical recipe
A solid default setup is:
- Define a dedupe key using alert name + service + env + region
- Group alerts in your alerting system using that key
- Set a cooldown so repeats don’t re-page for 15–30 minutes
- Page only for criticals, send warnings elsewhere
- Use “for”/hold-down to avoid flapping
- Suppress symptom alerts when a known root-cause incident is active
If you use Prometheus + Alertmanager
A common config pattern is:
route:
group_by: ['alertname', 'service', 'env']
group_wait: 30s
group_interval: 5m
repeat_interval: 2h
group_bydedupes similar alertsgroup_waitgives time for related alerts to arrive before paginggroup_intervalcontrols how often new notifications for the same group are sentrepeat_intervalcontrols when to re-notify if it’s still firing
Good dedupe key design
Include dimensions that matter operationally:
- what broke
- where it broke
- which customer or region is impacted
Exclude dimensions that cause noise:
- individual request IDs
- transient hostnames
- pod restarts
- exact exception line numbers unless essential
Rule of thumb
If two alerts would lead you to take the same action, they should probably be deduped into one notification.
If you want, I can give you:
- a Prometheus/Alertmanager config example,
- a PagerDuty dedupe strategy, or
- a generic algorithm for deduping alerts in code.