-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "Continue escalation if >X alerts per Y minutes" escalation step #2636
Conversation
if self.pause_escalation: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
escalation_chain_exists
should not depend on pause_escalation
, these are two separate properties that are not dependent on each other. For example, an alert group that has a proper escalation chain could be paused, and it would be a totally valid state.
if ( | ||
self.is_restricted | ||
or is_on_maintenace_or_debug_mode | ||
or self.pause_escalation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escalations for paused alert groups should not be skipped. Paused alert groups should be escalated further and get handled by the "Continue escalation if >X alerts per Y minutes" step.
if alert.is_the_first_alert_in_group or alert.group.pause_escalation: | ||
alert.group.start_escalation_if_needed(countdown=TASK_DELAY_SECONDS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main change of the PR: run start_escalation_if_needed
not only when receiving the first alert, but also when the group is paused (see comment above).
# Check that setting pause_escalation to True doesn't make the snapshot empty | ||
assert alert_group.build_raw_escalation_snapshot() != EMPTY_RAW_ESCALATION_SNAPSHOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the test to reflect this change.
|
||
|
||
@pytest.mark.django_db | ||
def test_distribute_alert_escalate_alert_group_when_escalation_paused( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a test to check that escalate_alert_group
task is called for paused alert groups (i.e. paused alert groups get handled by the escalation step). There's already a test that checks the actual step behaviour here.
# Conflicts: # CHANGELOG.md
What this PR does
Fixes a faulty escalation step "Continue escalation if >X alerts per Y minutes".
Which issue(s) this PR fixes
#895
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)