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

[APM] Service inventory: detailed stats fetched for all services #133697

Closed
dgieselaar opened this issue Jun 7, 2022 · 1 comment · Fixed by #134844
Closed

[APM] Service inventory: detailed stats fetched for all services #133697

dgieselaar opened this issue Jun 7, 2022 · 1 comment · Fixed by #134844
Assignees
Labels
apm:service-inventory apm:test-plan-done Pull request that was successfully tested during the test plan bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support v8.4.0

Comments

@dgieselaar
Copy link
Member

dgieselaar commented Jun 7, 2022

Instead of fetching detailed stats for only the services displayed on the current page, we are fetching them for all services loaded, which could be 1000s. This defeats the purpose of filtering on serviceNames: loading data for only the visible services should be a performance improvement. This will just slow it down due to the cost of the term query. Additionally, because it's a query parameter, it might cause issues with HTTP Servers, as the recommendation usually is to have a max length for the entire query string of 1024 characters.

return callApmApi('GET /internal/apm/services/detailed_statistics', {
params: {
query: {
environment,
kuery,
start,
end,
serviceNames: JSON.stringify(
mainStatisticsData.items
.map(({ serviceName }) => serviceName)
// Service name is sorted to guarantee the same order every time this API is called so the result can be cached.
.sort()
),
offset:
comparisonEnabled && isTimeComparison(offset)
? offset
: undefined,
},
},
});

This has been the case since the initial implementation in #107094 (7.15). We should:

  • only fetch data for visible services
  • use the request body (and a POST) for passing down serviceNames
  • investigate whether there are other places where this bug potentially happens
@dgieselaar dgieselaar added bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support labels Jun 7, 2022
@elasticmachine
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:service-inventory apm:test-plan-done Pull request that was successfully tested during the test plan bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support v8.4.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants