-
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] Fix agent status count #95099
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.
🚀
@@ -0,0 +1,86 @@ | |||
/* |
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.
thanks for adding tests!
@@ -138,7 +139,7 @@ export async function getAgentsByKuery( | |||
|
|||
return { | |||
agents, | |||
total: agents.length, | |||
total: res.body.hits.total.value, |
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 way I interpret lines 134-138 are that if showUpgradeable
is true, agents
will be narrowed to only include upgradeable agents.
What would this return in that case? It appears the count will before the full/initial list, but agents
would be a list of only upgradeable agents. i.e. potentially an array of 3 items but a total: 5
.
It's totally possible I misunderstand what's happening here. Thanks for researching and sending a PR.
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.
showUpgradeable
is a little weird here as the filtering is happening when we get the results,I am wondering if we can implement the show upgradeable as a filter in the ES query it will make things easier, otherwise I guess it's ok to have an inaccurate total for the show upgradeable filter an create an issue for that.
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.
My first review should have been 🚢 , too. Thanks again for the fix & test
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @nchaulet |
Hi @EricDavisX Observations:
Build details:
Thanks |
Summary
Resolve #95037
Fix a bug introduced here #94632
Changing the total of the method getAgent was incorrect and it's causing a bug where agent status in the listing status bar is not shown.
I also added a test for that endpoint
/agent-status