Skip to content

[BUG] Repeated Alertmanager/Grafana notifications create duplicate incidents and can re-apply fixes #124

Closed

Description

@OkiriGabriel

Problem

/webhook/alertmanager and /webhook/grafana create a new incident for every firing alert in every delivery (api/server.py, _alert_context → enqueue_incident). Nothing deduplicates on the alert's identity.

Alertmanager and Grafana re-send the same firing alert many times:

  • every group_interval when anything in the group changes;
  • every repeat_interval (default 4h) while it keeps firing;
  • after restarts or failovers, and when HA Alertmanager replicas each deliver.

The result is duplicate incidents for one problem. Each one runs a full diagnosis (LLM cost) and can apply the remediation again (another rollback, restart or cleanup), send duplicate Slack approvals, and escalate to PagerDuty more than once. Code reviews already got head-SHA dedupe in #104/#109; alerts have none.

Suggested fix

  • Use the alert's fingerprint (Alertmanager and Grafana both send it), or a hash of sorted labels when it's missing, together with startsAt as the identity.
  • If an incident for that identity is pending, processing, or finished within a cooldown (ALERT_DEDUPE_WINDOW_SEC, default e.g. 1h), don't enqueue. Return {"status": "duplicate", "incident_id": ...}.
  • Store the dedupe marker outside the poll path, as fix: keep review dedupe off the poll path, require open Bitbucket PRs, and retry failed heads #109 does for reviews.
  • A new startsAt (the alert resolved and fired again) is a new incident.
  • Tests: the same payload twice gives one incident; same labels with a new startsAt give two; Grafana and Alertmanager behave the same.

Activity

  1. added
    bug
    integration
    on Oct 24, 2026
  2. added a commit that references this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugintegration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions