Repository navigation
[APM] Add ML expected model bounds as an option to Comparison controls - #132456
Conversation
|
Pinging @elastic/ml-ui (:ml) |
peteharverson
left a comment
There was a problem hiding this comment.
Tested and LGTM with the lower bounds of the ML model plot now displaying correctly.
I don't think we should look to display the model bounds in the sparklines shown in the Services list and Map at this stage. Those searches need to be optimized for speed for which we should investigate using sampling. Also with the limited width and height of the sparklines there may be little value in trying to show model bounds here.
|
++ agree that showing model bounds in the sparklines is not desirable. |
| comparisonEnabled: toBooleanRt, | ||
| comparisonEnabled: comparisonEnabledRt, |
There was a problem hiding this comment.
I think we can just leave this unchanged. We don't need an intermediate type for toBooleanRt
| value: TimeRangeComparisonEnum.ExpectedBounds, | ||
| text: disabled | ||
| ? i18n.translate('xpack.apm.comparison.mlExpectedBoundsDisabledText', { | ||
| defaultMessage: 'Expected bounds (select other environment)', |
There was a problem hiding this comment.
We should mention that anomaly detection must be enabled for the environment:
| defaultMessage: 'Expected bounds (select other environment)', | |
| defaultMessage: 'Expected bounds (anomaly detection must be enabled for env)', |
💛 Build succeeded, but was flakyFailed CI StepsMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @qn895 |
|
Merging this PR as the one failed test for the latest build doesn't seem to be related to changes in this PR. A big thank you to the APM team for all your help 🙏 |
elastic#132456) * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * Refactor to use offset with TimeRangeComparisonEnum.ExpectedBounds * Change comparisonColor to be part of anomalySeries * Fix i18n * Add Comparison text to replace 'Previous period' * Fix expected bounds legend default to first * Hide values that are N/A in the tooltips * Fix i18n, color, and null values in tooltips * Refactor to use preferredEnvironment * Don't disable expected bounds by default * Match color of expected bounds with time comparison color * Fix tests * Use bucket_span as minBucketSize for anomaly results * Fix previousPeriodColor undefined for latency chart * Remove 'Comparison:' in legend * Change anomalyTimeseriesColor to use currentPeriod to match stuff * Fix type error * Fix lower model bounds * Add comments * Remove fit * Remove comparisonEnabledRt * Change text Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit c1d0ec5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ontrols (#132456) | [APM] Fix ML expected bounds missing data in chart, option showing when not neccessary (#132975) (#133826) * [APM] Add ML expected model bounds as an option to Comparison controls (#132456) * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * Refactor to use offset with TimeRangeComparisonEnum.ExpectedBounds * Change comparisonColor to be part of anomalySeries * Fix i18n * Add Comparison text to replace 'Previous period' * Fix expected bounds legend default to first * Hide values that are N/A in the tooltips * Fix i18n, color, and null values in tooltips * Refactor to use preferredEnvironment * Don't disable expected bounds by default * Match color of expected bounds with time comparison color * Fix tests * Use bucket_span as minBucketSize for anomaly results * Fix previousPeriodColor undefined for latency chart * Remove 'Comparison:' in legend * Change anomalyTimeseriesColor to use currentPeriod to match stuff * Fix type error * Fix lower model bounds * Add comments * Remove fit * Remove comparisonEnabledRt * Change text Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit c1d0ec5) * [APM] Fix ML expected bounds missing data in chart, option showing when not neccessary (#132975) * Only show expected bounds option in Overview/Transactions subpage of Services * Bucket span * Fix bucket span didn't show up in chart * Change fixed interval to 60s, add elastic-charts ref * ui settings remembering * Address comments * Address comments * Fix linting * Move data point down instead of extending range * Change to last, add test * Fix to use xValuesExpectedBounds * Revert change to to add extra point as es ml already handled it Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 017c8e1) Co-authored-by: Quynh Nguyen <43350163+qn895@users.noreply.github.com> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
elastic#132456) * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * [ML] Add bounds options * [ML] Renable anomalyChartTimeseries boundaries * [ML] Make it into string * [ML] Make it into string * Match colors * [ML] Add comparisonEnabledRt * [ML] Fix types, tests * [ML] Revert json bucket span change * Refactor to use offset with TimeRangeComparisonEnum.ExpectedBounds * Change comparisonColor to be part of anomalySeries * Fix i18n * Add Comparison text to replace 'Previous period' * Fix expected bounds legend default to first * Hide values that are N/A in the tooltips * Fix i18n, color, and null values in tooltips * Refactor to use preferredEnvironment * Don't disable expected bounds by default * Match color of expected bounds with time comparison color * Fix tests * Use bucket_span as minBucketSize for anomaly results * Fix previousPeriodColor undefined for latency chart * Remove 'Comparison:' in legend * Change anomalyTimeseriesColor to use currentPeriod to match stuff * Fix type error * Fix lower model bounds * Add comments * Remove fit * Remove comparisonEnabledRt * Change text Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR addresses #121520 and adds an option to show ML model bounds in the comparison controls and re-enable the expected bounds from ML anomaly detection jobs as comparison option to Latency, Throughput, and Failed Transaction Rate charts.
If user can access machine learning jobs, but there are no* ML jobs that match the currently selected environment, the

Expected boundsoption will be shown but will be disabled:When user can access machine learning jobs, and there are ML jobs that match the current environment,

Expected boundswill be enabled:When

Expected boundsis selected for comparison:When switching environment, and there are no ML jobs that match the new environment,
Expected boundswill be disabled, and the current selection will default to the first available time comparison option.Screen.Recording.2022-05-20.at.17.55.28.mov
When a time range comparison is used, the legend for the charts will show
Comparison: Day beforeComparison: Week before, orComparison: {period of time}`. Additionally, tooltip will no longer show series with N/A or null values.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:
For maintainers