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

[Fleet] Stop fetching all full or with agentCount agent policies #191661

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Aug 28, 2024

Summary

Related to https://github.com/elastic/ingest-dev/issues/3343

Currently the Fleet UI is really slow with 500 agents policies, 1 minute loading the agent tab, same for the enrollment api keys, to be able to fully support 500 agent policies (and in the future more), we should stop fetching all the agent policies with the full flag or with agent count from the UI, as this cause very long API request and make the UI not usable. (we could still fetch them using the perPage flag).

That PR does that, by making fetching agent policies without agent count the default.

As part of that PR I also added a small script that allow to quickly generate a big number of agent policies bypassing Fleet APIs that usefull for testing.

It could be called from the Fleet plugin folder with

node scripts/create_agent_policies/index.js

Why that change matter?

This is the performance of calling the agent policies endpoint with 500 agent policies (on a macbook)

With ?full and agentCount => 49s
Screenshot 2024-08-29 at 9 18 42 AM

Without ?full and no agentCount => 266ms
Screenshot 2024-08-29 at 9 19 18 AM

Questions

How can we prevent call to get all the agent policies with agent count or full to be introduced in the future?

Should we introduce a maximum validation to the perPage on the API side if full or noAgentCount=false?

@obltmachine
Copy link

🤖 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!)

@nchaulet
Copy link
Member Author

/ci

@nchaulet nchaulet force-pushed the feature-remove-fetching-all-policies-server-side branch from 36fca6b to df8b1ce Compare August 28, 2024 20:19
@nchaulet
Copy link
Member Author

/ci

@nchaulet
Copy link
Member Author

/ci

@nchaulet nchaulet self-assigned this Aug 29, 2024
@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 29, 2024
@nchaulet nchaulet force-pushed the feature-remove-fetching-all-policies-server-side branch from 3216a30 to 1fec585 Compare August 29, 2024 13:33
@nchaulet
Copy link
Member Author

/ci

@nchaulet nchaulet marked this pull request as ready for review August 29, 2024 14:25
@nchaulet nchaulet requested a review from a team as a code owner August 29, 2024 14:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

…policy/list_page/index.tsx

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 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
fleet 1.8MB 1.8MB +607.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 169.8KB 169.9KB +136.0B

History

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

cc @nchaulet

@nchaulet nchaulet requested review from a team and juliaElastic August 29, 2024 19:07
Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@nchaulet nchaulet merged commit e433dc2 into elastic:main Aug 30, 2024
22 checks passed
@nchaulet nchaulet deleted the feature-remove-fetching-all-policies-server-side branch August 30, 2024 11:53
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants