-
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
[Fleet] Improve performance of data stream API #97058
Conversation
Pinging @elastic/fleet (Team:Fleet) |
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.
Left two comments, but nothing blocking.
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @jen-huang |
* Improve performance of data stream API * Remove extra logger, replace filter with reduce * Remove unused import
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
* Improve performance of data stream API * Remove extra logger, replace filter with reduce * Remove unused import # Conflicts: # x-pack/plugins/fleet/server/routes/data_streams/handlers.ts # x-pack/plugins/fleet/server/services/epm/packages/get.ts
* Improve performance of data stream API * Remove extra logger, replace filter with reduce * Remove unused import Co-authored-by: Jen Huang <[email protected]>
* Improve performance of data stream API * Remove extra logger, replace filter with reduce * Remove unused import # Conflicts: # x-pack/plugins/fleet/server/routes/data_streams/handlers.ts # x-pack/plugins/fleet/server/services/epm/packages/get.ts
…ax_primary_shard_size * 'master' of github.com:elastic/kibana: (99 commits) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) Index patterns server - throw correct error on field caps 404 (elastic#95879) Use `EuiThemeProvider` in lists plugin tests and stories (elastic#96129) [npm] upgrade caniuse database (elastic#97002) chore(NA): moving @kbn/apm-utils into bazel (elastic#96227) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
…to-metrics-tab * 'master' of github.com:elastic/kibana: (61 commits) [Usage collection] Usage counters (elastic#96696) UI actions readme (elastic#96925) [TSVB] Enable brush for visualizations created with no index patterns (elastic#96727) [Data telemetry] Add Async Search to the tests (elastic#96693) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) ...
Great improvement!
When is this "upfront" exactly happening? On package installation? Another way I was thinking of it to only retrieve it the first time the user actually clicks on a data stream and then cache it. |
@ruflin One call upfront means when the user hits |
Summary
Resolves #97044. This PR improves the performance of
GET /api/fleet/data_streams
endpoint. Previously, we were retrieving dashboard information for each package, one dashboard ID at a time. This caused the endpoint to become slower and slower as the number of data streams/installed packages grew. And in some cases with unluckly timing against other ES operations/searches, this can cause the endpoint to time out or throw a500
search_phase_execution_exception
error.With this PR, we retrieve dashboard information for all installed packages with one call upfront, and map the results for fast lookup in downstream operations. In my testing of 116 data streams, with 4 packages installed, this reduced the average response time from 2.5s to 180ms, more than 10x improvement:
Before
After