-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Improves Data drift time range selection & show hints for analysis process #174049
Conversation
] | ||
); | ||
|
||
const onElementClick: ElementClickListener = useCallback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
Screen.Recording.2024-01-04.at.16.32.34.mov
</div> | ||
</div> | ||
) : ( | ||
<EuiText color="subdued" size="s" textAlign="center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we only allow the analysis to be run when a selection is made in both charts? Currently it looks like a default range is set in the Comparison chart on selection in the Reference chart but the brush only appears when you perform a click in the Reference chart. The other option would be to add brushes to both charts when the first click is made in either chart.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
Screen.Recording.2024-01-04.at.16.32.34.mov
} | ||
if (showRunAnalysisHint) { | ||
return ( | ||
<EuiEmptyPrompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You could break that inline component out into its own component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 7963cae
locale={i18n.getLocale()} | ||
/> | ||
<Axis | ||
id="data-drift-histogram-left-axis" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we have to create more dynamic ids here since the chart will show up multiple times in the UI? Or is this just something internal to the code since it's canvas based and the id might not end up in the DOM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 7963cae
|
||
/** | ||
* SingleBrush React Component | ||
* Dual brush component that overlays the document count chart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dual brush component
-> Single brush component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 7963cae
|
||
return { | ||
min: Math.round(baselineMin), | ||
max: Math.round(baselineMax), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I agree it's the right thing to do here to duplicate the charts/brush code from AIOps first to get this feature in. This way there's no risk to introduce regressions in the original code. However, there's some potential for code consolidation. Some of the code related to the brushes is quite complex and diverged versions will be tricky to maintain in the long run. Suggest to do the following:
- Create an issue that documents which files have been duplicated, similar to what we did for AIOps here: [ML] AIOps Labs: Code consolidation. #136182
- Add comments to the duplicated files that reference the original file, here's an example: https://github.com/elastic/kibana/blob/main/x-pack/plugins/aiops/public/application/utils/search_utils.ts#L8
- As a follow up in the long run we should move the different chart and brush versions to a new package. There they might still be different components, but we can at least consolidate some types and utilities that overlap.
* | ||
* @param windowParameters Baseline and deviation time ranges. | ||
* @param force Force update | ||
* @param logRateAnalysisType `spike` or `dip` based on median log rate bucket size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
/** | ||
* Callback function which gets called when the brush selection has changed | ||
* | ||
* @param windowParameters Baseline and deviation time ranges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mentions baseline/deviation which isn't applicable to the singular chart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
|
||
function onWindowParametersChange( | ||
wp: SingleBrushWindowParameters, | ||
wpPx: SingleBrushWindowParameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wpPx
arg can be removed, it's not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
{windowParameters && ( | ||
<> | ||
<DualBrushAnnotation | ||
id="aiopsBaseline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aiopsBaseline
-> data-drift-annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
return 'data-drift-' + b.id; | ||
}) | ||
.attr('data-test-subj', (b: SingleBrush) => { | ||
// Uppercase the first character of the `id` so we get aiopsBrushBaseline/aiopsBrushDeviation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment still mentions aiops
and both brushes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 42cedad
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes LGTM.
@elasticmachine merge upstream |
d33969b
to
f88bb8e
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @qn895 |
…s process (elastic#174049) ## Summary Enhances the selection behavior in the Data Drift view to allow time ranges which overlap in the Reference and Comparison data sets to be analyzed. Improvements include: - Allow for the Reference and Comparison time range to be able to overlap - Click on each chart to set the time range - Prompts and hints for user https://github.com/elastic/kibana/assets/43350163/55f01e41-76e0-4a23-a41c-137349a84bf1 ### Checklist - [ ] 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) - [ ] [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)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Enhances the selection behavior in the Data Drift view to allow time ranges which overlap in the Reference and Comparison data sets to be analyzed. Improvements include:
Screen.Recording.2024-01-04.at.16.32.34.mov
Checklist