-
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
[ML] Fix time range query in the Anomaly detection alert execution #93939
Conversation
Pinging @elastic/ml-ui (:ml) |
|
||
const topAnomaly = requestedAnomalies[0]; | ||
const alertInstanceKey = getAlertInstanceKey(topAnomaly._source); | ||
const formatter = getResultsFormatter(params.resultType as AnomalyResultType); |
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.
params.resultType
is being cast as AnomalyResultType
a lot of times in this file. can the MlAnomalyDetectionAlertParams
type be updated to make this correct?
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.
Fixed in d15f9fd
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.
Code LGTM
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.
UI text LGTM. Thanks!
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 and LGTM
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 latest edits and LGTM
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @darnautov |
Summary
The
date_histogram
agg withfixed_interval
is used for preview purposes, but it's not reliable for alert execution because of the buckets rounding. In this PR a higher-order data histogram agg has been removed, so the query simply checks the relative time interval.Checklist