keep icon indicating copy to clipboard operation
keep copied to clipboard

[🐛 Bug]: resolve_on all_resolved never closes an incident holding a suppressed alert (e.g. Sentry 'ignored')

Open jobordu opened this issue 4 weeks ago • 1 comments

Describe the bug

An incident with resolve_on: all_resolved never resolves if one of its alerts is suppressed, even after every other alert has resolved and the suppressed one will never fire again.

resolve_incident_if_require (incidents_bl.py#L432-L442) calls is_all_alerts_resolved, which is is_all_alerts_in_status(..., AlertStatus.RESOLVED) (db.py#L5316-L5330). That check requires every alert's status (or enriched status) to be exactly resolved. suppressed counts as "not resolved", so the incident stays firing forever.

Providers map a "the user decided to stop caring" state to SUPPRESSED. The Sentry provider maps ignored to AlertStatus.SUPPRESSED (sentry_provider.py#L94). So archiving a Sentry issue keeps its Keep incident open, when it should close.

To Reproduce (observed on v0.54.2; the code above is unchanged on main)

  1. A correlation rule with resolve_on: all_resolved groups two alerts into one incident.
  2. Resolve alert A. Send alert B with status: suppressed (for example a Sentry issue that is ignored).
  3. The incident stays firing, and nothing short of a manual resolve closes it.

Expected behavior Configurable. For example, an incident-level (or rule-level) set of statuses that count as "done" for all_resolved, defaulting to [resolved] so current behavior is unchanged, with suppressed optionally added. Or a separate resolve_on: all_resolved_or_suppressed.

Our workaround Our bridge sends Sentry ignored as resolved and carries the true status in a tag. That loses the distinction Keep's model was built to keep.

I'll open a PR with the configurable-set approach and tests, unless maintainers prefer a different shape.

Related: #6194 (all_resolved not closing when alerts are resolved by enrichment), now closed.

jobordu avatar Nov 02 '26 18:11 jobordu

I have opened PR #6928 to resolve this issue: https://github.com/keephq/keep/pull/6928

Summary of Fix

  • Updated to treat as a terminal status alongside , allowing incidents with to properly resolve once inactive/suppressed alerts (e.g. Sentry ignored) and active alerts are resolved.
  • Generalized to accept multiple target statuses, safely checking and native alert with queries.
  • Updated (, ) to honor .
  • Added regression tests in covering single and multiple alerts with resolved, suppressed, and firing states.

almagas avatar Nov 11 '26 00:11 almagas