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] Add tooltip when upgradeable = false and "Upgrade agent" action is disabled #173281

Open
1 of 2 tasks
kpollich opened this issue Dec 13, 2023 · 11 comments
Open
1 of 2 tasks
Labels
Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@kpollich
Copy link
Member

kpollich commented Dec 13, 2023

Currently, Fleet will disable the "Upgrade" action in the actions dropdown when an agent is determined to be non-upgradeable. We should try to surface why this is in a tooltip.

image

Fleet has some extensive logic around this derived is_agent_upgradeable flag here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/services/is_agent_upgradeable.ts

We should add a notion of "error codes" or some kind of status string that maps to a meaningful human readable message we can report in a tooltip when hovering over the disabled "Upgrade" action.

Tasks

  1. Team:Fleet
@kpollich kpollich added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 13, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@ycombinator
Copy link
Contributor

Fleet has some extensive logic around this derived is_agent_upgradeable flag here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/services/is_agent_upgradeable.ts

One of the conditions in this logic is:

  if (!agent.local_metadata.elastic.agent.upgradeable) {
    return false;
  }

AFAIK the agent.local_metadata.elastic.agent.upgradeable variable here is ultimately sourced from the boolean local_metadata.elastic.agent.upgradeable field that Agent sends the to Fleet in check-in API requests. If so, we'll probably want to add a sibling field, e.g. local_metadata.elastic.agent.upgradeable_reason or similar, to convey the reason why Agent is not upgradeable.

@kpollich
Copy link
Member Author

AFAIK the agent.local_metadata.elastic.agent.upgradeable variable here is ultimately sourced from the boolean local_metadata.elastic.agent.upgradeable field that Agent sends the to Fleet in check-in API requests. If so, we'll probably want to add a sibling field, e.g. local_metadata.elastic.agent.upgradeable_reason or similar, to convey the reason why Agent is not upgradeable.

Yes this is accurate. Fleet can do a best effort for some of the other derived values in that file above, but I'd expect most cases where this is disabled to be a result of that local_metadata flag. Perhaps an enhancement to agent where a specific reason code is surfaced in this metadata that explains an agent is running under hypervisor, was installed via .deb or .rpm archive, etc etc that Fleet can eventually pass through to the UI would be good to track here as well.

@kpollich
Copy link
Member Author

I've added some implementation detail tasks here. We'll need contributions in both Fleet and Agent to make this happen.

cc @jen-huang @jlind23 for prioritization.

@lucabelluccini
Copy link
Contributor

This might be related elastic/elastic-agent#3906

@amitkanfer
Copy link

Even a link to a doc laying out all possible reasons for an agent being "not upgradeable" can go a long way.

@criamico
Copy link
Contributor

criamico commented Dec 14, 2023

I have a PR where I'm doing something similar, I'm returning a message explaining the reason why the agent is not upgradeable.

I'm sure that this could be handled in a better way if we do further changes to the elastic agent, as for now when the agent returns "not_upgradeable" Fleet has no way to know why.

@jlind23
Copy link
Contributor

jlind23 commented Dec 14, 2023

#173253 would be a good first step before doing all the changes from Elastic Agent to Fleet.

criamico added a commit that referenced this issue Dec 19, 2023
)

Closes #171840
Also implements the UI part of
#173281

## Summary
When trying to upgrade a single agent that is not upgradeable, the error
message doesn't specify _why_ the agent cannot be upgraded. This PR is
introducing:
- More granular error messages in the endpoint `POST
agent/{agent_id}/upgrade`. The messages are now different depending on
which conditions are met. For the case when the agent is reported not
upgradeable from elastic agent, there is now an error message the states
it explicitly.
- When clicking on the `upgrade 1 agent` from the bulk actions, if the
agent is not upgradeable the submit button is now greyed out and a
message explaining the reason is shown:
- 
![Screenshot 2023-12-18 at 14 41
48](https://github.com/elastic/kibana/assets/16084106/8e0a03b4-c8fc-4a2e-aea6-77c7cc1acdf3)

The same warning appears when clicking on other upgrade actions in the
bulk action menu, but only for a single agent. Multiple upgrades have
not been changed.

- In the agents list, reuse the existing tooltip besides the version to
show the same messages when the agent is not upgradeable:
![Screenshot 2023-12-18 at 14 40
32](https://github.com/elastic/kibana/assets/16084106/ada30bc0-8c58-40d9-b7cf-c5c7a81a75f7)




### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@criamico
Copy link
Contributor

criamico commented Mar 4, 2024

Tooltip and a warning message explaining why an agent is not upgradeable were merged in in 8.13. I think that we'll need some work on the elastic agent side to be able to implement the rest of the points outlined in the description.
Do we know if that part was already implemented in elastic agent? If not, I think we'll need to move this ticket to blocked until it's done.
cc @kpollich @jen-huang

@jlind23
Copy link
Contributor

jlind23 commented Mar 11, 2024

Do we know if that part was already implemented in elastic agent? If not, I think we'll need to move this ticket to blocked until it's done.

AFAIK it is not done yet, maybe @pierrehilbert has a tracking issue that we can reference here.

@pierrehilbert
Copy link
Contributor

This is not implemented in Elastic Agent yet.
We don't have a dedicated issue (at least that I'm aware of) about this.
The most related one is elastic/elastic-agent#3906 that includes this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

No branches or pull requests

8 participants