Alert rules: support grouped logic (AND/OR) in trigger conditions
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
### Problem Statement
**Problem**
In Sentry alert configuration, trigger conditions currently allow choosing “any” or “all” of the listed conditions, but that choice applies to the entire list. This makes it impossible to express rules that require grouped logic, such as combining an AND pair inside an OR rule.
**What we want**
We want to receive an alert when any of these groups matches:
1. Both thresholds are met (AND group):
- Number of events in an issue is more than 100 in one day
- Number of users affected by an issue is more than 15 in one day
OR
2. Issue changes state from resolved → unresolved
OR
3. Issue changes state from archived → escalating
In boolean form:
`(events > 100 in 1 day AND users affected > 15 in 1 day)`
`OR (state: resolved → unresolved)`
`OR (state: archived → escalating)`
### Solution Brainstorm
Add condition groups such as:
- “Add group” (each group can be AND/ALL)
- Top-level selector to combine groups (typically OR/ANY)
### Product Area
Alerts
Contributor guide
Research direction
Start by locating the alert configuration and trigger-condition implementation described in the issue. Review how the current list-wide “any” or “all” choice is represented, then trace the alert evaluation path. Done means grouped conditions support the requested AND-within-OR behavior, including the two state-transition alternatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100