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] Delayed data test for Anomaly Detection jobs health rule type #107183

Merged
merged 32 commits into from Aug 5, 2021

Conversation

darnautov
Copy link
Contributor

@darnautov darnautov commented Jul 29, 2021

Summary

Part of #101028

Adds the delayed data test for Anomaly Detection jobs health rule type.

image

Rule executor looks up for delayed_data events in the annotations index within the provided time interval.

Checklist

@darnautov darnautov added :ml Feature:Anomaly Detection ML anomaly detection v8.0.0 auto-backport Deprecated: Automatically backport this PR after it's merged v7.15.0 Feature:Alerting/RuleTypes Issues related to specific Alerting Rules Types labels Jul 29, 2021
@darnautov darnautov self-assigned this Jul 29, 2021
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.

I left three minor suggestions.

@darnautov darnautov marked this pull request as ready for review August 2, 2021 11:31
@darnautov darnautov requested a review from a team as a code owner August 2, 2021 11:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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!

@darnautov darnautov added the release_note:feature Makes this part of the condensed release notes label Aug 2, 2021
@darnautov darnautov requested a review from walterra August 2, 2021 12:27
Copy link
Contributor

@walterra walterra 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

@darnautov
Copy link
Contributor Author

@alvarezmelissa87 looks like you have some issues with the Kibana configuration, could be SSL related. Let me know if you need some help with the setup

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

minor things, but looking great

x-pack/plugins/ml/server/lib/alerts/jobs_health_service.ts Outdated Show resolved Hide resolved
x-pack/plugins/ml/server/lib/alerts/jobs_health_service.ts Outdated Show resolved Hide resolved
x-pack/plugins/ml/server/lib/alerts/jobs_health_service.ts Outdated Show resolved Hide resolved
const job = jobs.find((j) => j.job_id === v.job_id);
const datafeed = datafeeds?.find((d) => d.job_id === v.job_id);

const jobLookbackInterval = resolveLookbackInterval([job!], [datafeed!]);
Copy link
Member

Choose a reason for hiding this comment

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

👍 this is great.

Get them all in the same query, then filter down appropriately. good stuff.

@qn895
Copy link
Member

qn895 commented Aug 4, 2021

Small UI thing I found while testing - wildcard doesn't seem to work with prefixes.

Screen.Recording.2021-08-04.at.11.01.46.mov

@darnautov
Copy link
Contributor Author

@qn895 hey! thanks for reviewing. We don't support wildcards for the jobs selection. Just a special case for all jobs (with * symbol)

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.

Helper tooltips LGTM!

Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
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

@darnautov darnautov enabled auto-merge (squash) August 5, 2021 11:00
@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 5.9MB 6.0MB +10.8KB

History

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

cc @darnautov

@darnautov darnautov merged commit 39bd188 into elastic:master Aug 5, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2021
…lastic#107183)

* [ML] enable test selection

* [ML] executor update for annotations

* [ML] update unit tests

* [ML] fix i18n

* [ML] update schema

* [ML] fix ts

* [ML] account for docs count, update unit tests

* [ML] update translation strings

* [ML] add types

* [ML] fetch the latest annotation sorted by modified_time

* [ML] getDelayedDataAnnotations

* [ML] update unit tests

* [ML] set default number of docs to 1, update schema validation

* [ML] getDelayedDataLookbackTimestamp

* [ML] filter null values, update unit tests

* [ML] account for query delay, refactor with memoize

* [ML] update unit test

* [ML] remove previousStartedAt

* [ML] filter based on the job config

* [ML] fix tests

* [ML] add maps

* [ML] combine filters

* [ML] move range query inside of a filter

* [ML] filter out jobs with missing datafeed

* [ML] resolveLookbackInterval only from jobs with datafeeds

* [ML] do not show an error on empty time interval

* [ML] add help tooltips

* [ML] update description for the datafeed check
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Aug 5, 2021
…107183) (#107762)

* [ML] enable test selection

* [ML] executor update for annotations

* [ML] update unit tests

* [ML] fix i18n

* [ML] update schema

* [ML] fix ts

* [ML] account for docs count, update unit tests

* [ML] update translation strings

* [ML] add types

* [ML] fetch the latest annotation sorted by modified_time

* [ML] getDelayedDataAnnotations

* [ML] update unit tests

* [ML] set default number of docs to 1, update schema validation

* [ML] getDelayedDataLookbackTimestamp

* [ML] filter null values, update unit tests

* [ML] account for query delay, refactor with memoize

* [ML] update unit test

* [ML] remove previousStartedAt

* [ML] filter based on the job config

* [ML] fix tests

* [ML] add maps

* [ML] combine filters

* [ML] move range query inside of a filter

* [ML] filter out jobs with missing datafeed

* [ML] resolveLookbackInterval only from jobs with datafeeds

* [ML] do not show an error on empty time interval

* [ML] add help tooltips

* [ML] update description for the datafeed check

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
streamich pushed a commit to vadimkibana/kibana that referenced this pull request Aug 8, 2021
…lastic#107183)

* [ML] enable test selection

* [ML] executor update for annotations

* [ML] update unit tests

* [ML] fix i18n

* [ML] update schema

* [ML] fix ts

* [ML] account for docs count, update unit tests

* [ML] update translation strings

* [ML] add types

* [ML] fetch the latest annotation sorted by modified_time

* [ML] getDelayedDataAnnotations

* [ML] update unit tests

* [ML] set default number of docs to 1, update schema validation

* [ML] getDelayedDataLookbackTimestamp

* [ML] filter null values, update unit tests

* [ML] account for query delay, refactor with memoize

* [ML] update unit test

* [ML] remove previousStartedAt

* [ML] filter based on the job config

* [ML] fix tests

* [ML] add maps

* [ML] combine filters

* [ML] move range query inside of a filter

* [ML] filter out jobs with missing datafeed

* [ML] resolveLookbackInterval only from jobs with datafeeds

* [ML] do not show an error on empty time interval

* [ML] add help tooltips

* [ML] update description for the datafeed check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged Feature:Alerting/RuleTypes Issues related to specific Alerting Rules Types Feature:Anomaly Detection ML anomaly detection :ml release_note:feature Makes this part of the condensed release notes v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants