-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[responseOps] add snoozing MVP in alerting framework #127694
Conversation
99f8ce6
to
e45b79f
Compare
resolves elastic#126512 Changes the calculation of rule-level muting to take into account snoozeEndTime. If muteAll is true, the rule is considered snoozing forever, regardless of the setting of snoozeEndTime. If muteAll is false, snoozeEndTime determines whether the rule is snoozed. If snoozeEndTime is null, the rule is not snoozed. Otherwise, snoozeEndTime is a Date, and if it's >= than Date.now(), the rule is snoozed. Otherwise, the rule is not snoozed.
045937d
to
99f5e68
Compare
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
LGTM! Nice job :)
Verified by:
- creating an Always Firing rule with server log action
- snoozing via API with snooze_end_time and verifying that no actions were written until snooze_end_time has passed
- snoozing via API with snooze_end_time = -1 and verifying that no actions were written until setting unmuting via API
@elasticmachine merge upstream |
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.
Love the way you did it, simplicity === hard
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.
Changes LGTM! Tested locally and saw the notifications stop until the end time 👍
expect(connStatus).to.be(200); | ||
objectRemover.add(Spaces.space1.id, createdAction.id, 'action', 'actions'); | ||
|
||
log.info('creating rule'); |
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.
question: should these logs be info
or debug
? I believe CI used to or still captures the debug logs whenever a flaky or failed test happens.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
resolves #126512
Changes the calculation of rule-level muting to take into account snoozeEndTime.
If muteAll is true, the rule is considered snoozing forever, regardless of the setting of snoozeEndTime.
If muteAll is false, snoozeEndTime determines whether the rule is snoozed. If snoozeEndTime is null, the rule is not snoozed. Otherwise, snoozeEndTime is a Date, and if it's >= than Date.now(), the rule is snoozed. Otherwise, the rule is not snoozed.
this PR branch was originally based off of #127081
testing locally
To test, create a rule that is firing all the time that you can check - using server log is usually the easiest. Use a 1s interval so you will see the effect quicker.
To set a snooze, use the following curl command:
Note the time value should be an ISO date - using a Z at the end implies UTC, without a Z, assumes local.
You can also use the value -1 (not a string) which functions the same as "mute all".
To "unsnooze", currently you have to use "unmute all":
Checklist
Delete any items that are not applicable to this PR.