-
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
Onboard "Custom Threshold" rule type with FAAD #179284
Onboard "Custom Threshold" rule type with FAAD #179284
Conversation
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
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; alert doc looks good in the expected index; was able to cause an alert to recover and see it updated in the alert index
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.
Tested locally and worked as expected! 💪🏻
Added one question about tests and a nit.
@@ -58,24 +57,37 @@ export interface CustomThresholdLocators { | |||
logsExplorerLocator?: LocatorPublic<LogsExplorerLocatorParams>; | |||
} | |||
|
|||
export type CustomThresholdAlert = Omit< |
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.
nit: maybe we can move this type to the types.ts
file in this directory.
@@ -184,63 +271,63 @@ describe('The custom threshold alert type', () => { | |||
test('alerts as expected with the > comparator', async () => { | |||
setResults(Comparator.GT, [0.75], true); | |||
await execute(Comparator.GT, [0.75]); | |||
expect(mostRecentAction(instanceID)).toBeAlertAction(); | |||
expect(getLastReportedAlert(instanceID)).toBeAlertAction(); |
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 am a bit confused now, is this checking an alert or action? It seems we are getting an alert (getLastReportedAlert) but checking an action (toBeAlertAction).
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 old implementation causes this confusion.
We used to create an alert and then schedule actions for each actionGroups (alert, warning, recovered etc.)
Now we just report an alert with action group, no separate action scheduling.
Maybe we can rename toBeAlertAction
to toHaveAlertAction
?
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.
Maybe we can rename
toBeAlertAction
totoHaveAlertAction
?
I like this suggestion 👍🏻
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.
done.
💚 Build Succeeded
Metrics [docs]History
To update your PR or re-run it, just comment with: cc @ersin-erdal |
Towards: #169867
This PR onboards "Custom Threshold" rule type with FAAD.
To verify
Create a Custom Threshold rule by using a test index and DW. Set the
Role visibility
metrics
.When the rule runs, it generates an alert and saves it under
.internal.alerts-observability.threshold.alerts-default
.The alert should be visible on
Observability > alerts
page as well.