Skip to content

[ML] Adds new Data comparison view - #161365

Merged
qn895 merged 73 commits into
elastic:mainfrom
qn895:data-drift-part-1
Jul 31, 2023
Merged

qn895 merged 73 commits into
elastic:mainfrom
qn895:data-drift-part-1

Conversation

@qn895

@qn895 qn895 commented Jul 6, 2023 •

Copy link
Copy Markdown
Member

Summary

Follow up of the original proof-of-concept PR which started as a onweek project. This PR introduces the new Data Comparison view in ML. This view lies under Data Visualizer in the navigation, and showcases the biggest difference in each field for two different time ranges of data.

Screen.Recording.2023-07-06.at.09.43.24.mov

Part of this PR also includes some refactoring to consolidate code within ML/AIOps/Data Visualizer plugin. Changes include:

  • A new @kbn/ml-in-memory-table package which contains useTableState
  • Moved DocumentCountChart from plugins/aiops to @kbn/ml-aiops-components
  • Moved getDefaultQuery and type SearchQueryLanguage to @kbn/ml-query-utils
  • Modified DocumentCountChart to take additional props to showcase colors for the annotation and different labels for the brush

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@qn895 qn895 self-assigned this Jul 6, 2023
@qn895 qn895 changed the title Initialize Data comparison view (Refactor & fix conflicts from poc PR) [ML] Add new Data comparison view Jul 6, 2023
@qn895
qn895 force-pushed the data-drift-part-1 branch from 28fcf9c to 0f10040 Compare July 6, 2023 15:17
@qn895
qn895 force-pushed the data-drift-part-1 branch from 0f10040 to f991036 Compare July 6, 2023 15:19
@qn895
qn895 force-pushed the data-drift-part-1 branch from 58e6a65 to 61c5da3 Compare July 11, 2023 04:58
@qn895 qn895 added the ci:cloud-deploy Create or update a Cloud deployment label Jul 11, 2023
@peteharverson

peteharverson commented Jul 11, 2023 •

Copy link
Copy Markdown
Contributor

Adding a comment for feedback as I test:

  • I assume this only works for data views with timestamps? In which case, we should add a similar callout to that used on the AIOps pages:
image
  • If we keep this inside the Data visualizer nav grouping, we should consider changing the routing for the breadcrumbs so that the 'Data visualizer' header in the left nav no longer acts as a link to the select data view / file page. Otherwise if I click on the 'Data visualizer' breadcrumb it takes me out of the Data comparison workflow and into the data visualizer selector page.
image
  • Using packetbeat-7.10.0-2021-03-10-no-sunburst* - run an analysis with client.bytes > 10. After completion edit the filter to client.bytes > 100 and when it reruns the page crashes with this error:
image
  • There is a - after the progress bar %, which works for e.g. Explain Log Rate spikes as we append text on the stage the analysis is in, but we should remove it here, unless you can think of text to add after the -
image
  • I find that for larger data sets that it can take a while for the progress to move past 0%, is there some text we could add to indicate something is happening at this initial stage?

@qn895
qn895 requested a review from walterra July 11, 2023 19:31
barColorOverride,
barStyleAccessor,
barHighlightColorOverride,
deviationBrush = {},

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: Passing some additional optional overrides here


const forceRefresh = useCallback(() => setLastRefresh(Date.now()), [setLastRefresh]);

const randomSampler = useMemo(

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.

Have you run into this error when using the random sampler. Here the error occurs even at 50% sampling rate. Is there anything we can do to prevent this, or add a suggestion to the error callout to try increasing / turning off random sampling:

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should be fixed with this change 05245ea (#161365)

@qn895
qn895 force-pushed the data-drift-part-1 branch from 05245ea to 5d078fd Compare July 26, 2023 14:51
@qn895
qn895 force-pushed the data-drift-part-1 branch from 5d078fd to bf34f73 Compare July 26, 2023 15:13
@qn895

qn895 commented Jul 26, 2023

Copy link
Copy Markdown
Member Author

@elasticmachine merge upstream

@peteharverson peteharverson left a comment

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.

Tested latest changes and LGTM

@walterra walterra left a comment

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.

Latest changes LGTM. Just added a small note that another plain string could be replaced by a constant. Would also be good to take note to follow up at some point with code consolidation with the parts that are now somewhat duplicated from the aiops plugin.

basePath: string
): MlRoute => ({
id: 'data_view_data_comparison',
path: createPath('data_comparison_index_select'),

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.

This could use ML_PAGES.DATA_COMPARISON_INDEX_SELECT.

@qn895

qn895 commented Jul 31, 2023

Copy link
Copy Markdown
Member Author

@elasticmachine merge upstream

@qn895
qn895 enabled auto-merge (squash) July 31, 2023 14:08
@kibana-ci

kibana-ci commented Jul 31, 2023 •

Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 435 439 +4
dataVisualizer 348 538 +190
ml 1764 1770 +6
transform 363 366 +3
total +203

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
dataVisualizer 24 25 +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 535.2KB 539.6KB +4.4KB
dataVisualizer 376.0KB 605.0KB ⚠️ +229.0KB
ml 3.4MB 3.4MB +2.5KB
transform 404.6KB 404.7KB +83.0B
total +236.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/aiops-components 0 1 +1
dataVisualizer 0 1 +1
total +2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dataVisualizer 21.7KB 23.1KB +1.4KB
ml 73.9KB 74.0KB +157.0B
total +1.5KB
Unknown metric groups

API count

id before after diff
@kbn/aiops-components 6 30 +24
@kbn/ml-in-memory-table - 11 +11
@kbn/ml-query-utils 11 14 +3
@kbn/ml-random-sampler-utils 5 30 +25
dataVisualizer 28 31 +3
total +66

async chunk count

id before after diff
dataVisualizer 5 8 +3

ESLint disabled line counts

id before after diff
@kbn/aiops-components 0 2 +2
aiops 23 21 -2
dataVisualizer 32 45 +13
total +13

Total ESLint disabled count

id before after diff
@kbn/aiops-components 0 2 +2
aiops 23 21 -2
dataVisualizer 32 45 +13
total +13

History

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

cc @qn895

@qn895
qn895 merged commit 0728003 into elastic:main Jul 31, 2023
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jul 31, 2023
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@peteharverson peteharverson changed the title [ML] Add new Data comparison view [ML] Adds new Data comparison view Aug 22, 2023
szabosteve added a commit that referenced this pull request Aug 24, 2023
## Summary

Related PR: #161365
Related issue: https://github.com/elastic/platform-docs-team/issues/153

This PR drafts documentation for the new data comparison feature under
the Data Visualizer in Kibana.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 24, 2023
## Summary

Related PR: elastic#161365
Related issue: https://github.com/elastic/platform-docs-team/issues/153

This PR drafts documentation for the new data comparison feature under
the Data Visualizer in Kibana.

(cherry picked from commit e911038)
kibanamachine referenced this pull request Aug 24, 2023
…164722)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[DOCS] Adds documentation for data comparison view
(#164297)](#164297)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"István Zoltán
Szabó","email":"szabosteve@gmail.com"},"sourceCommit":{"committedDate":"2023-08-24T14:13:38Z","message":"[DOCS]
Adds documentation for data comparison view (#164297)\n\n##
Summary\r\n\r\nRelated PR:
https://github.com/elastic/kibana/pull/161365\r\nRelated issue:
https://github.com/elastic/platform-docs-team/issues/153\r\n\r\nThis PR
drafts documentation for the new data comparison feature under\r\nthe
Data Visualizer in
Kibana.","sha":"e91103811be0c731af056779ba20a30a89e34253","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs",":ml","release_note:skip","docs","v8.10.0","v8.11.0"],"number":164297,"url":"https://github.com/elastic/kibana/pull/164297","mergeCommit":{"message":"[DOCS]
Adds documentation for data comparison view (#164297)\n\n##
Summary\r\n\r\nRelated PR:
https://github.com/elastic/kibana/pull/161365\r\nRelated issue:
https://github.com/elastic/platform-docs-team/issues/153\r\n\r\nThis PR
drafts documentation for the new data comparison feature under\r\nthe
Data Visualizer in
Kibana.","sha":"e91103811be0c731af056779ba20a30a89e34253"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164297","number":164297,"mergeCommit":{"message":"[DOCS]
Adds documentation for data comparison view (#164297)\n\n##
Summary\r\n\r\nRelated PR:
https://github.com/elastic/kibana/pull/161365\r\nRelated issue:
https://github.com/elastic/platform-docs-team/issues/153\r\n\r\nThis PR
drafts documentation for the new data comparison feature under\r\nthe
Data Visualizer in
Kibana.","sha":"e91103811be0c731af056779ba20a30a89e34253"}}]}]
BACKPORT-->

Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
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 ci:cloud-deploy Create or update a Cloud deployment :ml release_note:feature Makes this part of the condensed release notes v8.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants