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: improve explanation of log rate spike/dip #182714

Closed
2 tasks done
alvarezmelissa87 opened this issue May 6, 2024 · 3 comments
Closed
2 tasks done
Assignees
Labels
Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml v8.15.0

Comments

@alvarezmelissa87
Copy link
Contributor

alvarezmelissa87 commented May 6, 2024

Related meta issue: #181111
Item:
Show both a baseline and deviation with doc count in the results table. It might be worth then not showing the raw doc count of the selection, but instead median doc count per histogram bucket to make the numbers comparable. Investigate if we can offer options to show both the raw full number of the selections and/or the median doc count per bucket.

Describe the feature:

One of the pain points of this view is that the pvalue isn't an intuitive value for most users. It would be useful to add a couple of columns to the table which display a more easily readable explanation of the change - e.g.
5x increase/decrease - for bucket and also for overall data.

To avoid having too many columns and making the table feel cluttered, we can reuse/use the Filter fields control to allow the user to hide/show particular columns. With this, we don't lose the pvalue column and we allow the user to view the columns that are most useful to them. We also retain the ability to sort by any of these values.

image

TASKS

@alvarezmelissa87 alvarezmelissa87 added :ml Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.15.0 labels May 6, 2024
@alvarezmelissa87 alvarezmelissa87 self-assigned this May 6, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra
Copy link
Contributor

walterra commented May 8, 2024

Screenshot of some experiments a while back for reference:

image

The tricky bit we need to consider:

At the moment the data in the results table doesn't know about the bucket size of the date histogram on top of it. So the overall baseline and deviation count can refer to different wide time ranges. This is a bit problematic for the explainability of the statements like 50x higher. To make it comparable we'd need to normalize the counts to be per date histogram bucket. In anomaly detection you're always comparing against the same bucket lengths.

Suggestion for a tooltip to explain how increase is calculated:

image

@walterra
Copy link
Contributor

Here's a PoC that creates strings like 114x increase based on background and foreground counts: https://github.com/elastic/kibana/pull/179695/files#diff-a278bf75b860fa4b13bc67ce102e8045e52000d912e1386177590f35c4f0651cR273-R281

    logRateChange:
        bgCount > 0
          ? logRateType === 'spike'
            ? `${Math.round((docCount / bgCount) * 100) / 100}x increase`
            : `${Math.round((bgCount / docCount) * 100) / 100}x decrease`
          : logRateType === 'spike'
          ? `${docCount} docs up from 0 in baseline`
          : `0 docs down from ${docCount} in baseline`,

Note this is really just to get started, that code misses normalization to properly compare background/foreground.

alvarezmelissa87 added a commit that referenced this issue Jun 10, 2024
…umns will be visible (#184262)

## Summary

Related meta issue: #182714

This PR adds controls to the AIOps results table to show/hide columns.

<img width="1100" alt="image"
src="https://github.com/elastic/kibana/assets/6446462/8e1f2913-614b-4fe2-884f-aa53760646e4">


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <[email protected]>
alvarezmelissa87 added a commit that referenced this issue Jun 24, 2024
…ip (#186342)

## Summary

Related issue: #182714

This PR adds a `Log rate change` column to Log rate analysis results
table.

The log rate change is calculated by getting the number of buckets for
baseline/deviation using the timerange and interval and then comparing
the average rates per bucket for baseline vs deviation.

<img width="1466" alt="image"
src="https://github.com/elastic/kibana/assets/6446462/9b2f1b80-d1d5-407e-908c-f611e54be4f3">

<img width="1471" alt="image"
src="https://github.com/elastic/kibana/assets/6446462/56cb2c35-3758-4b24-9f50-2f99242af1b3">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml v8.15.0
Projects
None yet
Development

No branches or pull requests

3 participants