elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.35k stars 7.98k forks source link

[APM UI] decrease bucket size top_dependencies sends to get_connection_stats query #182884

Closed neptunian closed 1 week ago

neptunian commented 1 week ago

Fixes https://github.com/elastic/kibana/issues/178491

Summary

The user receives a too_many_buckets exception when querying for 90 days worth of data and in many other longer time ranges. This is due to the date histogram within each service having time intervals that are too small.

Solution

Lowering numBuckets cause the time periods to increase because the algorithm divides the date the user selects by this number (duration / numBuckets). The larger the time range is, the more likely it will choose an interval that is larger, resulting in less buckets per date histogram.

The exception can still be thrown when users select time ranges that aren't caught in the algorithm, for eg selecting 4 years or more will cause the error should a user have around the max # of dependencies (1500). This is because our smallest time interval is 30 days and that interval becomes too small in a large time range. We can recommend in this case to increase the max bucket size in elasticsearch. There needs to be a balance with how much we try to stay under the default bucket limit vs letting the user change that size and get more data.

Scenarios of duration and numBucket size and the resulting # of buckets with the max of 1500 dependencies:

Screenshot 2024-05-08 at 7 41 22 AM

Changes

Testing

  1. Change the many_dependencies.ts synthtrace scenario to generate 1500 dependencies by changing these lines locally: const NUMBER_OF_DEPENDENCIES_PER_SERVICE = 15; const NUMBER_OF_SERVICES = 100;
  2. run node scripts/synthtrace many_dependencies.ts --live --clean locally
  3. run local kibana instance and navigate to APM dependencies inventory http://localhost:5601/app/apm/dependencies/inventory
  4. try various date ranges
apmmachine commented 1 week ago

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with: - `/oblt-deploy` : Deploy a Kibana instance using the Observability test environments. - `run` `docs-build` : Re-trigger the docs validation. (use unformatted text in the comment!)

neptunian commented 1 week ago

/ci

elasticmachine commented 1 week ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

neptunian commented 1 week ago

/oblt-deploy-serverless

kibana-ci commented 1 week ago

:green_heart: Build Succeeded

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.2MB 3.2MB -1.0B

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5407 +5407
total size - 8.8MB +8.8MB

History

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