kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[ML] APM Correlations: Fix chart errors caused by inconsistent histogram range steps.

Open walterra opened this issue 2 years ago • 6 comments

Summary

The AreaSeries for the latency correlations charts expect the provided timestamp keys for each series to be the same, otherwise there might be errors in how the chart renders the areas. In some cases this could happen because we fetch the data for the areas independently (for example overall latency and failed transactions latency).

The fix provided by this PR adds optional durationMin and durationMax parameters to affected endpoints. This way the durationMin/Max returned by the first area request (for example "overall latency") can be passed on to the second request to enforce the same buckets/keys (for example for "failed transaction latency").

This also updates the chart code to make use of some newly available styles in Elastic Charts for orphaned points (https://github.com/elastic/elastic-charts/pull/1505)

Before:

image

After:

image

Checklist

walterra avatar Aug 08 '22 12:08 walterra

Up for discussion: So far, as can be seen in the screenshots of the PR description, the area lines disappear when they are 0. As an alternative, we could show a continuous line:

image

walterra avatar Aug 08 '22 16:08 walterra

Pinging @elastic/ml-ui (:ml)

elasticmachine avatar Aug 09 '22 05:08 elasticmachine

Pinging @elastic/apm-ui (Team:apm)

elasticmachine avatar Aug 09 '22 14:08 elasticmachine

Tested and LGTM 🎉 As for whether to show the continuous line, I think it's less crowded to not show the line when the values are 0 but have no strong opinion about it.

qn895 avatar Aug 09 '22 14:08 qn895

Up for discussion: So far, as can be seen in the screenshots of the PR description, the area lines disappear when they are 0. As an alternative, we could show a continuous line:

image

@walterra I would prefer the lines would disappear if 0 as initially proposed.

formgeist avatar Aug 10 '22 10:08 formgeist

@formgeist @qn895 thanks for the feedback I kept original look now with the lines being interrupted when they hit 0.

walterra avatar Aug 11 '22 08:08 walterra

@cauemarcondes Thanks for your feedback, I addressed your comments, ready for another look.

walterra avatar Aug 11 '22 09:08 walterra

:yellow_heart: Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
apm 3.0MB 3.0MB +493.0B

History

  • :yellow_heart: Build #64159 was flaky 4ad0a05e622756287a64e4f681bf9240855acbfc
  • :yellow_heart: Build #63703 was flaky 64fff2930c986fe87b12337e1e6eabd606252ec1
  • :broken_heart: Build #63680 failed 4c7e405d75d102ae6faa0ff6679399c04e416efe
  • :broken_heart: Build #63584 failed 8d4cb803ee96e1f39791ca6f57630a29cf81ecf9

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

cc @walterra

kibana-ci avatar Aug 11 '22 10:08 kibana-ci

Tested latest changes and functionally LGTM 🎉

qn895 avatar Aug 11 '22 14:08 qn895

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine avatar Aug 11 '22 15:08 kibanamachine