Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Added ability to fire actions when an alert instance is resolved #82799
Added ability to fire actions when an alert instance is resolved #82799
Changes from 1 commit
fad1fe2
39f8587
378fa7c
8f48a39
676d8f1
f781dcb
e231074
53ac140
b4dc1f5
2d8f830
78a15c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I believe this will send a notification for a resolved instance event if the alert instance is muted (or if all instances are muted). Is that the expected behavior?
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.
Correct, we shouldn't be scheduling actions if the instance or alert is throttled/muted. We may want to make that check check a reusable function somewhere, wherever it's done today, so other call sites (like this one), can use it. Either that, or figure out how to include these new actions to be scheduled in the same place they are done today - sorry I haven't looked at where these places might be yet, but can poke around a bit more if you want - LMK.
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.
I believe only
muted
since throttle resets when action group changes?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.
Great catch! By the way, I'm not sure about the reusable function here - we need to identify if the alert is muted to skip the whole
scheduleActionsForResolvedInstances
call and passing down the list ofmutedInstanceIds
to skip it in the schedule function as well. I think we already have this information on the current function level about the specific alert. Or we should get here the most fresh by calling alertsClient get by alertId?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.
I've tested it with the UI PR part using PagerDuty incidents and it works fine now with handling the
mute
state. Will provide the api integration test as wellThere 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.
Wondering if we're going to find the empty context and state to be a problem 🤔
Should we perhaps remove the values expected in context and stat from the template variables in the UI?
Otherwise users might try to use them in actions when attaching to Resolved, no?
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.
I did it in the UI PR