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] Anomaly Detection: Fix validation error when no data in index. #86114

Merged
merged 11 commits into from
Dec 17, 2020

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Dec 16, 2020

Summary

Part of #78784

For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.

This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.

image

This also picks up work done in #78931 to allow users to create jobs when the source index doesn't include data yet. Previously, the call to job validation would fail and the user cannot continue:

Now we avoid making the call altogether, display a warning, but let the user continue:

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@walterra walterra added bug Fixes for quality problems that affect the customer experience release_note:fix :ml Feature:Anomaly Detection ML anomaly detection v8.0.0 v7.11.0 labels Dec 16, 2020
@walterra walterra requested a review from a team as a code owner December 16, 2020 14:40
@walterra walterra self-assigned this Dec 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra walterra force-pushed the ml-validation-cardinality-no-results branch from c7f35f9 to 1d06c6a Compare December 16, 2020 17:43
@peteharverson
Copy link
Contributor

I can get past the validation step in the multi-metric wizard, but in the advanced wizard I see this error on the Validation page and the Next button is disabled:

image

(Tested using a saved search against the gallery data set which returns 0 matching docs)

@walterra
Copy link
Contributor Author

@peteharverson Good catch. I implemented the solution we discussed in 431710e. Also updated the PR description.

if (typeof job === 'object') {
// Run job validation only if a job config has been passed on and the duration makes sense to run it.
// Otherwise we skip the call and display a generic warning, but let the user move on to the next wizard step.
if (typeof job === 'object' && duration.start !== null && duration.end !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

nit, this whole condition could be wrapped in an outer if (typeof job === 'object') {

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 b366241. Just became aware that this is still plain JavaScript so I added another check against typeof duration === 'object') too.

@walterra
Copy link
Contributor Author

In ae33db6 I updated the PR so the Next button in the job validation step is always enabled. If there is a message of type error returned from the job validation endpoint, we display an additional warning message.

image

This covers what has been started in this closed PR: #78931

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 and LGTM.

@jgowdyelastic do you know if there's an easy way to get rid of the 0 that appears in the last step of the multi metric wizard in place of the usual chart(s) when there is no data:

image

@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 7.0MB 7.0MB -409.0B

Distributable file count

id before after diff
default 47288 48048 +760

History

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

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.

LGTM

@walterra walterra merged commit 755dc7e into elastic:master Dec 17, 2020
@walterra walterra deleted the ml-validation-cardinality-no-results branch December 17, 2020 17:58
walterra added a commit to walterra/kibana that referenced this pull request Dec 17, 2020
…lastic#86114)

For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
walterra added a commit to walterra/kibana that referenced this pull request Dec 17, 2020
…lastic#86114)

For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
walterra added a commit that referenced this pull request Dec 18, 2020
…86114) (#86349)

For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
walterra added a commit that referenced this pull request Dec 18, 2020
…86114) (#86348)

For cardinality checks, an empty index of the fields checks not returning any results would block the user from moving to the next step in the Anomaly Detection job wizard.
This PR fixes it by adding more fine grained checks and only returning warning-level messages for the above cases. A warning-level message will allow the user to continue to the next step in the wizard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml release_note:fix v7.11.0 v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants