-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(metric_alerts): Fix bug where transitioning from critical -> warn…
…ing can still trigger a resolve action (#29345) Was investigating #27161, although I suspect that it's already resolved since it's from back in July and we pushed out a fix in Auguest. I happened to figure out the error we see on our own alert in #team-engineering though. Just to cover this issue again: - Metric goes above the critical threshold, so we fire a critical alert - Metric goes below critical but remains above warning. This should result in firing the warning threshold again, but actually it triggers a resolve. There are two parts to this issue. 1. Our metric alert is misconfigured, and doesn't have an action set up for warning. So warning thresholds will literally never fire or do anything. I have fixed this. 2. If the critical/warning actions are different, then the de-duping that we have in place won't work. In our case, since critical has an action and warning doesn't, we end up just using the critical action, which is tied to the resolve. This results in us showing a resolve notification. To fix this, when we transition from critical -> warning I only include the incident trigger associated with the active warning trigger in `fired_incident_triggers`, and leave the critical trigger out. This means that if someone configures an alert with both warning and critical triggers, but fails to set up an action on the warning trigger, then the only time the alert will fire is when the critical alert initially fires. I think this is most correct and realistically it doesn't make sense to set up a threshold without an action. We should probably prevent alerts from being created like this in the UI.
- Loading branch information
Showing
2 changed files
with
113 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters