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

Provide a diagnostics bundle on installation failure #5198

Open
AndersonQ opened this issue Jul 25, 2024 · 2 comments
Open

Provide a diagnostics bundle on installation failure #5198

AndersonQ opened this issue Jul 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@AndersonQ
Copy link
Member

Describe the enhancement:

Add a --with-diagnostics flag to generate a diagnostics bundle if there is any error when installing the Elastic Agent.

Describe a specific use case for the enhancement or feature:

If any error happens during the install and enroll process the Elastic Agent will clean up any leftover, if the installation happened it'll remove the installation folder together with all the logs. Logs which are valuable when trying to diagnose issues during install/enroll.

What is the definition of done?

When an installation using the --with-diagnostics flag fails, it should produce a diagnostics bundle containing, if available:

  • the installation logs. It's all the output shown to the user when invoking elastic-agent install ...
  • the Elastic Agent and its components logs
  • the installed Elastic Agent state
  • if possible the current configuration for each component

Ideally, the process controlling the installation would request a diagnostics from the agent daemon, if it isn't possible, it'd collect the necessary information

@AndersonQ AndersonQ added the enhancement New feature or request label Jul 25, 2024
@cmacknz
Copy link
Member

cmacknz commented Jul 25, 2024

Ideally, the process controlling the installation would request a diagnostics from the agent daemon, if it isn't possible

If installation fails, there likely is no running Elastic Agent daemon. If we've gotten that far, installation has actually succeeded.

We could write the install logs to disk in the directory the install command was run from. This saves a user from have to do this via copy paste. When installations are done via some orchestration tool like Ansible I'm not sure if this helps, because it adds another thing for users to have to remember to cleanup and pull off the machine.

@AndersonQ
Copy link
Member Author

We could write the install logs to disk in the directory the install command was run from. This saves a user from have to do this via copy paste. When installations are done via some orchestration tool like Ansible I'm not sure if this helps, because it adds another thing for users to have to remember to cleanup and pull off the machine.

We could write to the tmp directory of the system or, as you suggested on slack, on the folder where the agent binary is, so when the folder is deleted after the installation, those logs are also deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants