#6848·keep

[ Bug]: Grafana alert that resolves inside a still-firing group stays firing in Keep

Author: breken-aiCreated Sep 26, 2026Updated Sep 26, 2026

Describe the bug Grafana sends one webhook per alert group. The top-level status stays firing while any alert in the group is firing, and each entry in alerts[] carries its own status.

GrafanaProvider._format_alert (keep/providers/grafana_provider/grafana_provider.py:410-412, main @ fe5c8964) maps every alert from the top-level status:

python
status = GrafanaProvider.STATUS_MAP.get(event.get("status"), AlertStatus.FIRING)

So an alert that resolves while another alert in its group is still firing is stored as firing. Workflows and incidents never see the resolution. Grouped notifications are Grafana's default (grouped by alertname), so this affects most Grafana users. The line dates from #727.

To Reproduce

  1. Create a Grafana alert rule with two series, or two instances in one notification group.
  2. Let one instance resolve while the other keeps firing. Grafana sends status: firing with alerts: [{status: firing, ...}, {status: resolved, ...}].
  3. In Keep, the resolved instance is still firing.

Failing tests (red on main, green with the fix), in tests/providers/grafana_provider/test_grafana_v12_webhook.py::TestGroupedNotificationStatus:

  • test_each_alert_keeps_its_own_status (formatter). On main: {'d5fdbbe0a0a940c1': 'firing'} != 'resolved'.
  • test_resolved_alert_in_firing_group_is_stored_resolved, end to end through process_event and get_last_alerts (sqlite). On main the stored status is firing.
  • test_group_status_is_used_when_alert_has_none covers the fallback.

Expected behavior Each alert uses its own status and falls back to the group status only when it has none.

Additional context A fix with a regression test is ready: alert.get("status") or event.get("status"), on breken-ai/keep fix/grafana-per-alert-status. tests/providers + tests/test_provider_factory.py: 72 passed, and ruff is clean. The PR will follow once the CLA is signed (same account as #6805).

Prepared with AI assistance (Claude) from the breken-ai account.