-
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] Move APM Latency Correlations from flyout to transactions page. #107266
Conversation
c27b029
to
39f857c
Compare
2a7636f
to
a26728a
Compare
LGMT 🎉 |
x-pack/plugins/apm/public/components/app/correlations/error_correlations.tsx
Show resolved
Hide resolved
x-pack/plugins/apm/public/components/app/correlations/error_correlations.tsx
Show resolved
Hide resolved
x-pack/plugins/apm/public/components/app/correlations/error_correlations.tsx
Show resolved
Hide resolved
x-pack/plugins/apm/public/hooks/use_transaction_distribution_fetcher.ts
Outdated
Show resolved
Hide resolved
setCcsWarning(response.rawResponse?.ccsWarning ?? false); | ||
setHistograms(response.rawResponse?.values ?? []); | ||
setLog(response.rawResponse?.log ?? []); |
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.
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 ?? [],
...
})
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.
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.
x-pack/plugins/apm/public/hooks/use_transaction_trace_samples_fetcher.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service.ts
Outdated
Show resolved
Hide resolved
@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 | ||
); |
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 see fetchTransactionDurationPercentiles
is called twice. Is it possible to just call it once with the percentiles merged?
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.
Another question: in fetchTransactionDurationPercentiles
why is percents
optional? Shouldn't it be required?
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 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.
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.
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
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.
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.
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.
As discussed via Slack, pushed a refactor to reduce state handlers here: 1284687
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @walterra |
💔 Backport failed
To backport manually run: |
…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
Summary
Part of #106381
Trace samples
/Latency correlations
/Failed transactions correlations
useTransactionDistributionFetcher
touseTransactionTraceSamplesFetcher
. Instead of a histogram with top hits, this will now just return a sample of traces for the given filters.Checklist
Delete any items that are not applicable to this PR.