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] [AIOps] Log Rate Analysis: Shows top N results when no docs in baseline or deviation #171924

Merged
merged 20 commits into from Nov 29, 2023

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Nov 24, 2023

Summary

Resolves #169767.

This PR adds a fallback analysis when either the baseline or deviation time range contains no documents. Instead of trying to fetch significant items (which would return no results), this will just fetch the top terms/categories for the time range that has some documents.

Analysis type: Top items for deviation time range when no docs in baseline

image

Analysis type: Top items for baseline time range when no docs in deviation

image

Checklist

@walterra walterra self-assigned this Nov 24, 2023
@walterra walterra marked this pull request as ready for review November 24, 2023 17:07
@walterra walterra requested a review from a team as a code owner November 24, 2023 17:07
@walterra walterra added release_note:enhancement :ml Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.12.0 labels Nov 24, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

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. Just a couple of typos need correcting.

);
}

if (version === '2') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 1 and 2 look pretty much identical here - is this duplication purely for type reasons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a small difference, version 1 is accessing significantTerms whereas version 2 uses significantItems.

import { getQueryWithParams } from './get_query_with_params';
import { getRequestBase } from './get_request_base';

// TODO Consolidate with duplicate `fetchDurationFieldCandidates` in
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is an older comment I copied over, it's related to this issue where we track potential cleanups of duplicated code: #136182

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Left a couple of small comments but overall LGTM ⚡

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 421 422 +1

Async chunks

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

id before after diff
aiops 385.3KB 386.6KB +1.3KB

History

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

cc @walterra

@walterra walterra merged commit bbf95b0 into elastic:main Nov 29, 2023
31 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 29, 2023
@walterra walterra deleted the 169767-ml-aiops-no-docs-fallback branch November 29, 2023 18:03
@szabosteve szabosteve changed the title [ML] [AIOps] Log Rate Analysis: Show top N results when no docs in baseline or deviation. [ML] [AIOps] Log Rate Analysis: Shows top N results when no docs in baseline or deviation Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:enhancement v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] AIOps Log Rate Analysis: Show top N results when no docs in baseline or deviation.
6 participants