-
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] Redesign agent flyout #128381
[Fleet] Redesign agent flyout #128381
Conversation
Submitted a PR to fix a few things here: criamico#1 |
@elasticmachine merge upstream |
Pinging @elastic/fleet (Team:Fleet) |
x-pack/plugins/fleet/public/components/agent_enrollment_flyout/instructions.tsx
Outdated
Show resolved
Hide resolved
I noticed a broken feature in Add agent flyout, with Fleet Server instructions:
Also, when closing the flyout and navigating to other fleet tabs, I am getting this error:
|
After enrolling a Fleet Server, and opening Add agent flyout, I see failing agent_status queries with this error:
|
@juliaElastic Thanks for testing it out! I'm looking at these issues. |
x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_select_create.tsx
Show resolved
Hide resolved
@juliaElastic would you mind testing again those issues? I pushed a commit that should fix them. |
@elasticmachine merge upstream |
Thanks, the fleet server enroll flow is fixed now. |
I tested the flow of enrolling agent to Fleet, and I see the UI updated to show that 1 agent has enrolled, and incoming data is confirmed. A few observations:
|
return ( | ||
<EuiText> | ||
<FormattedMessage | ||
id="xpack.fleet.enrollmentInstructions.troubleshootingText" |
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.
nit: the troubleshooting link could be extracted to a small component
x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx
Outdated
Show resolved
Hide resolved
* @param policyId | ||
* @returns | ||
*/ | ||
export const usePollingAgentCount = (policyId: string | undefined) => { |
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.
unit tests are missing, I think you can add them in another pr
No, I still have to fix the state of the last two steps and the spinners. I'll check it.
No it should stop when the flyout closes. It is a bug.
I think it's supposed to be |
I pushed a commit where I addressed most of the problems, however I still need to fix the endpoints that keep getting called after closing the panel. |
x-pack/plugins/fleet/public/components/agent_enrollment_flyout/confirm_agent_enrollment.tsx
Outdated
Show resolved
Hide resolved
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.
It seems like after creating one agent, navigating back into the flyout incurs this "empty state" in the dropdown. I think this is similar to the issue @juliaElastic reported above.
I noticed that when there is no Fleet Server enrolled initially, there is no way to see the Agent standalone instructions (which doesn't require Fleet Server). |
@kpollich I couldn't reproduce this, do you have only one policy in the dropdown? It is expected to have an empty dropdown if you have at least 2 policies (e.g. fleet server policy, agent policy) |
IMO it's more confusing to open the flyout and it already have this bright green success UI shown before the user has done anything? Maybe we could enhance this in the future to have 2 separate indicators:
|
BTW feel free to merge without my approval, I may not get to this today. |
The confirmation will only show up if someone enrolled an agent to the selected agent policy in the last few minutes. That is unlikely to be done by someone else, isn't it? |
should the labels be updated to |
I think they want it merged for 8.2, but I'll check again. |
I'm having trouble getting past the "Confirm incoming data" step in Cloud. I'm enrolling an agent in a basic Agent Policy that just includes the
My agent starts up as expected, and Fleet reports that it's enrolled, but the "Confirm incoming data" spinner never goes away. I let it sit for 15ish minutes with no change. Here's what I think is the relevant polling request from my network tab:
|
Ok, so there's still some problem there. The polling request is similar to this one Screen.Recording.2022-04-11.at.15.23.43.movThe other thing that I had to do to see the data is to check that the fleet server host in the settings has the correct IP (http://DOCKERHOST_IP:8220) and I also pass it to the docker command (in addition to your command):
|
I see, even so, |
@juliaElastic @kpollich I added a check that should solve the problem with the fail retries in the incoming data component. I'm filtering out agents that have |
I tested and the polling works for me now, eventually I see the data confirmed on the flyout. |
setIsLoading(false); | ||
// filter out agents that have `data = false` and keep polling | ||
const filtered = data?.items.filter((item) => { | ||
const key = Object.keys(item)[0]; |
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.
in case of multiple agentIds
being queried, do they come in separate objects in items
array? so we are not missing anything by taking the first key only, right?
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.
No there's no problem there, the schema is something like
[ { 'agentid1': { data: true }, { 'agentid2': { data: false }, ... ]
so there's only one key for each item of the array.
Here is where this schema is defined:
agentIdsWithData.includes(id) ? { [id]: { data: true } } : { [id]: { data: false } } |
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.
LGTM, thanks for fixing the review comments
Thanks a lot for your help! It's better to catch those issues early :) |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @criamico |
* [Fleet] Redesign and refactor agent flyout * Further refactoring * More refactoring and some bug fixing * bug fixing * Fix step tests + skip standalone tab tests * Use test-subj for agent policy code block to fix cypress tests * Fixing small issues on rendering * Fix broken import; Fix button in incoming data comp * Fix loading; add button in incoming data step * Fix some failures * Fix tests * Fix checks * Address code review comments; add retry logic to incoming data component * Fix download link * Check enrolled agents in last 10 minutes * Filter out agents with data=false from incoming data Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kyle Pollich <[email protected]> (cherry picked from commit 6e8d979)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
* [Fleet] Redesign and refactor agent flyout * Further refactoring * More refactoring and some bug fixing * bug fixing * Fix step tests + skip standalone tab tests * Use test-subj for agent policy code block to fix cypress tests * Fixing small issues on rendering * Fix broken import; Fix button in incoming data comp * Fix loading; add button in incoming data step * Fix some failures * Fix tests * Fix checks * Address code review comments; add retry logic to incoming data component * Fix download link * Check enrolled agents in last 10 minutes * Filter out agents with data=false from incoming data Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kyle Pollich <[email protected]> (cherry picked from commit 6e8d979) Co-authored-by: Cristina Amico <[email protected]>
Summary
Redesign of agent enrollment flyout: #125534
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers