Skip to content

[ML] Change point detection: support for multiple metric and split fields#154237

Merged
darnautov merged 30 commits intoelastic:mainfrom
darnautov:ml-151592-change-point-enhancements
Apr 12, 2023
Merged

[ML] Change point detection: support for multiple metric and split fields#154237
darnautov merged 30 commits intoelastic:mainfrom
darnautov:ml-151592-change-point-enhancements

Conversation

@darnautov
Copy link
Copy Markdown
Contributor

@darnautov darnautov commented Apr 3, 2023

Summary

Part of #151592

  • Adds support for multiple metric and split fields
  • Updates the change point results layout to the table view
  • Adds support for viewing selected change points

Apr-04-2023 15-51-24

Checklist

There is one issue about the aria-expanded attribute not being allowed for the EuiAccordion button element used as div, but it has to be fixed on the EUI side. See elastic/eui#6689.

@darnautov darnautov added release_note:enhancement :ml Team:ML Team label for ML (also use :ml) t// v8.8.0 labels Apr 3, 2023
@darnautov darnautov requested a review from walterra April 3, 2023 12:45
@darnautov darnautov self-assigned this Apr 3, 2023
@darnautov
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@darnautov darnautov requested a review from qn895 April 4, 2023 13:55
@darnautov darnautov marked this pull request as ready for review April 4, 2023 13:55
@darnautov darnautov requested a review from a team as a code owner April 4, 2023 13:55
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@darnautov darnautov added the ci:cloud-deploy Create or update a Cloud deployment label Apr 4, 2023
@darnautov darnautov requested a review from peteharverson April 11, 2023 14:21
@darnautov
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream


const onChange = useCallback(
(update: FieldConfig, index: number) => {
fieldConfigs.splice(index, 1, update);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did we want to mutate fieldConfigs in place here? Considering we didn't for onAdd.

@qn895
Copy link
Copy Markdown
Member

qn895 commented Apr 11, 2023

Latest code changes LGTM 🎉

Copy link
Copy Markdown
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.

Really like that update!

In the latest version I tested, the annotations didn't show up unfortunately. There's also this strange hovering effect where hovering in the dropdowns triggers hovering in non-related items:

aiops-cpd-hover-0001

One other thing I noticed is the loading behaviour: When changing the split field and there's some loading time, the empty prompt let's me think there are no results, just the very top left global loading indicator is running. After a while though the table with results appears. It would be great if we could show a loading skeleton or similar instead of the empty prompt.

aiops-cpd-loading-behavior-0001

const defaultSorting = {
sort: {
field: 'p_value',
// Lower p_value indicates a bigger change point, hence the acs sorting
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Type acs => asc

<EuiFlexGrid columns={resultPerPage.length >= 2 ? 2 : 1} responsive gutterSize={'m'}>
{resultPerPage.map((v) => {
return (
<EuiFlexItem key={v.group?.value ?? 'single_metric'}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the update in this PR to be able to select items from different groups, I was able to hit a Warning: Encountered two children with the same key for this. For example, with the cloudwatch dataset I create this setup (NetworkIn/NetworkOut by region):

image

Then from both metrics I selected the same field/value (region:ap-northwest-1) which will trigger the error in the flyout

image

@darnautov
Copy link
Copy Markdown
Contributor Author

darnautov commented Apr 12, 2023

@walterra thanks for checking it!

In the latest version I tested, the annotations didn't show up unfortunately.

Indeed, with my latest refactoring I accidentally changed the wrong property, fixed in a2da9d2

There's also this strange hovering effect where hovering in the dropdowns triggers hovering in non-related items:

This behaviour comes from the EuiAccordion. I wonder if we should change it 🤔

When changing the split field and there's some loading time, the empty prompt let's me think there are no results, just the very top left global loading indicator is running. After a while though the table with results appears. It would be great if we could show a loading skeleton or similar instead of the empty prompt.

Updated: enhancements for the loading behaviour were added here

@darnautov darnautov requested a review from walterra April 12, 2023 12:32
@darnautov
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

kibana-ci commented Apr 12, 2023

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #8 / machine learning - data visualizer index based with farequote KQL saved search displays index details
  • [job] [logs] FTR Configs #8 / machine learning - data visualizer index based with farequote lucene saved search displays index details

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 474 479 +5

Async chunks

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

id before after diff
aiops 759.6KB 766.1KB +6.5KB
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 433 436 +3

Total ESLint disabled count

id before after diff
securitySolution 512 515 +3

History

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

cc @darnautov

@darnautov darnautov removed the ci:cloud-deploy Create or update a Cloud deployment label Apr 12, 2023
Copy link
Copy Markdown
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.

LGTM. Great addition, and I like the new loading indicator!

Copy link
Copy Markdown
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.

Latest changes LGTM.

@darnautov darnautov merged commit c3e6e70 into elastic:main Apr 12, 2023
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Apr 12, 2023
@darnautov darnautov deleted the ml-151592-change-point-enhancements branch April 12, 2023 15:59
@peteharverson peteharverson changed the title [ML] Support multiple change point requests [ML] Change point detection: support for multiple metric and split fields Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting :ml release_note:enhancement Team:ML Team label for ML (also use :ml) t// v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants