Skip to content
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] Move APM Latency Correlations from flyout to transactions page. #107266

Merged
merged 61 commits into from
Aug 17, 2021

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Jul 30, 2021

Summary

Part of #106381

  • Moves APM Latency Correlations from flyout to transactions page.
  • Introduces a tab based navigation for Trace samples / Latency correlations / Failed transactions correlations
  • For trace samples, the previous low detailed histogram chart gets replaced with the new log log based histogram chart. Users can drag select a range of lantency to filter trace samples.
  • Removes code related to the previous distribution chart. Renames useTransactionDistributionFetcher to useTransactionTraceSamplesFetcher. Instead of a histogram with top hits, this will now just return a sample of traces for the given filters.

apm-latency-correlations-1

Checklist

Delete any items that are not applicable to this PR.

@walterra walterra force-pushed the ml-apm-correlations-page branch from 2a7636f to a26728a Compare August 4, 2021 22:26
@qn895
Copy link
Member

qn895 commented Aug 13, 2021

LGMT 🎉

Comment on lines 64 to 66
setCcsWarning(response.rawResponse?.ccsWarning ?? false);
setHistograms(response.rawResponse?.values ?? []);
setLog(response.rawResponse?.log ?? []);
Copy link
Member

Choose a reason for hiding this comment

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

Same as above. Why a different state handler for each? If we want to cherry-pick certain props we can do

setResponse({
  ccsWarning: response.rawResponse?.ccsWarning ?? false,
  histogram: response.rawResponse?.values ?? [],
  ...
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally we just had a single setRawResponse (see 2b36190#diff-e78a6067e533c365dc4359166ad8c11d74df73448ffffb7c071f4c2e09aca969L51). It made it difficult to manage the loading behavior of the chart, because a refresh would trigger a reset and empty the chart and not an in-place update.

Since we moved some parts of the response to single state handlers it seemed counter-intuitive to still have a [response, setResponse] state handler around which didn't handle the full response.

We could return to use a single setResponse but then it would need to be set with a callback considering the previous state to handle the update and avoid the full chart reset. Let me know what you prefer.

@walterra
Copy link
Contributor Author

@sqren Thanks for the feedback, addressed your comments so this is ready for another look.

…r selection to display correct annotation and first sample.
esClient,
params,
percentileAggregationPercents
);
Copy link
Member

Choose a reason for hiding this comment

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

I see fetchTransactionDurationPercentiles is called twice. Is it possible to just call it once with the percentiles merged?

Copy link
Member

Choose a reason for hiding this comment

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

Another question: in fetchTransactionDurationPercentiles why is percents optional? Shouldn't it be required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The calls serve different purposes:

  • The first time it's called to retrieve the actual value of the 95th percentile. We want to do that call in any case because it ends up as the 95p marker for the log log chart which can also be retrieved for the trace samples tab without correlation analysis.
  • The second time it's called we fetch a different variant of percentiles which after that are used as parameters for correlation analysis which is optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We plan to revisit the service though, e.g. use msearch/bsearch, nested aggs etc., there are some caveats though regarding to error reporting we need to consider. We have an item "Optimize ES queries (e.g. summarize field/value queries as part of nested aggs or multi search" on the meta issue here: #106381

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding percents being optional: I don't remember exactly, but maybe the idea was for the helper getTransactionDurationPercentilesRequest() to retain the capability of the ES API to use the defaults, maybe we made use of this in an earlier version. We don't use it with defaults at the moment though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed via Slack, pushed a refactor to reduce state handlers here: 1284687

@walterra walterra added the auto-backport Deprecated - use backport:version if exact versions are needed label Aug 17, 2021
@walterra walterra enabled auto-merge (squash) August 17, 2021 09:58
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1598 1601 +3

Async chunks

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

id before after diff
apm 4.3MB 4.3MB +1.4KB

History

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

cc @walterra

@walterra walterra merged commit d07f7a5 into elastic:master Aug 17, 2021
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 107266

@walterra walterra deleted the ml-apm-correlations-page branch August 17, 2021 15:42
walterra added a commit that referenced this pull request Aug 17, 2021
…107266) (#108938)

- Moves APM Latency Correlations from flyout to transactions page.
- Introduces a tab based navigation for `Trace samples` / `Latency correlations` / `Failed transactions correlations`
- For trace samples, the previous low detailed histogram chart gets replaced with the new log log based histogram chart. Users can drag select a range of lantency to filter trace samples.
- Removes code related to the previous distribution chart. Renames `useTransactionDistributionFetcher` to `useTransactionTraceSamplesFetcher`. Instead of a histogram with top hits, this will now just return a sample of traces for the given filters.

# Conflicts:
#	x-pack/plugins/apm/server/lib/transactions/distribution/get_buckets/index.ts
@walterra walterra mentioned this pull request Aug 24, 2021
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:correlations auto-backport Deprecated - use backport:version if exact versions are needed :ml release_note:enhancement Team:APM All issues that need APM UI Team support v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants