Skip to content
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

Merged
merged 4 commits into from
Mar 8, 2021

Conversation

darnautov
Copy link
Contributor

@darnautov darnautov commented Mar 8, 2021

Summary

The date_histogram agg with fixed_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

@darnautov darnautov added bug Fixes for quality problems that affect the customer experience :ml Feature:Anomaly Detection ML anomaly detection v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v7.13.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Mar 8, 2021
@darnautov darnautov requested a review from peteharverson March 8, 2021 14:06
@darnautov darnautov self-assigned this Mar 8, 2021
@darnautov darnautov requested a review from a team as a code owner March 8, 2021 14:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)


const topAnomaly = requestedAnomalies[0];
const alertInstanceKey = getAlertInstanceKey(topAnomaly._source);
const formatter = getResultsFormatter(params.resultType as AnomalyResultType);
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d15f9fd

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

Copy link
Contributor

@szabosteve szabosteve left a 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!

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM

Copy link
Contributor

@peteharverson peteharverson left a 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

@kibanamachine
Copy link
Contributor

💚 Backport successful

7.12 / #93994
7.x / #93995

Successful backport PRs will be merged automatically after passing CI.

@darnautov darnautov deleted the ML-alerting-fix-date-agg branch March 9, 2021 07:06
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 6.4MB 6.4MB +1.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @darnautov

kibanamachine added a commit that referenced this pull request Mar 9, 2021
…ion (#93939) (#93995)

* [ML] Fix time range query in the Anomaly detection alert execution  (#93939)

* [ML] fix i18n

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 9, 2021
…tion (#93939) (#93994)

* [ML] Fix time range query in the Anomaly detection alert execution  (#93939)

* [ML] fix i18n

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants