-
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] Configure sorting for partition values on Single Metric Viewer #81510
[ML] Configure sorting for partition values on Single Metric Viewer #81510
Conversation
… support for partition config
…partition-sorting # Conflicts: # x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx
58f7fa3
to
d2710c9
Compare
Pinging @elastic/ml-ui (:ml) |
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've mainly focused on the logic to construct the filters and the queries since I don't know the code base that well. I think you have the condition on filtering to the selected time range back to front, but otherwise looks good.
x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts
Outdated
Show resolved
Hide resolved
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.
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.
Functional tests LGTM
...plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx
Outdated
Show resolved
Hide resolved
...plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts
Outdated
Show resolved
Hide resolved
applyTimeRange: boolean; | ||
sort: { | ||
by: string; // 'anomaly_score' | 'name'; | ||
order: string; // 'asc' | 'desc'; |
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 this type be updated with the commented code?
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.
Yes, updated in c4203a3
@elasticmachine merge upstream |
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.
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
History
To update your PR or re-run it, just comment with: |
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 edits LGTM ⚡
…81510) (#82295) * [ML] fix callout styles * [ML] refactor timeseriesexplorer.js, add series_controls.tsx, storage support for partition config * [ML] anomalousOnly support * [ML] sort by control * [ML] update query * [ML] sort order controls * [ML] adjust query * [ML] merge default and local configs, add info * [ML] fix types, adjust sorting logic for model plot results * [ML] fix translation keys * [ML] fixed size for the icon flex item * [ML] fix time range condition, refactor * [ML] change info messages and the icon color * Fix model plot info message Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co> * [ML] functional tests * [ML] rename ML_ENTITY_FIELDS_CONFIG * [ML] support manual input * [ML] show max record score color indicator * [ML] use :checked selector * [ML] refactor functional tests * [ML] extend config with "applyTimeRange", refactor with entity_config.tsx * [ML] info messages * [ML] remove custom message * [ML] adjust the endpoint * [ML] customOptionText * [ML] sort by name UI tweak * [ML] change text * [ML] remove TODO comment * [ML] fix functional test * [ML] move "Anomalous only"/"Apply time range" control to the bottom of the popover * [ML] update types
Summary
Resolves #69526.
Allows configuring entities dropdowns individually on the Single Metric Viewer with the following parameters:
By default shows only anomalous values, sorting descending by the record score.
In case "Anomalous only" is disabled there are two possible scenarios:
Model plot is disabled, so we remove time boundaries from the query showing values for all existing records. The info icon provides an explanation about suggested options.
Model plot is enabled, hence we look up for model plot results, disabling sorting by the anomaly score. The info icon shows another helper text in this case.
Also, show a color indicator for each option based on the max anomaly score for the value. In case the model plot is enabled and not only anomalous values have been requested an indicator is not presented.
The configuration is stored in the browser's local storage under
ml.singleMetricViewer.partitionFields
key.Checklist