Add conn param and conn-skip flag to diagnostics command #4946
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add CONN param to control protocol so the elastic-agent can use CONN as an additional parameter when requesting diagnostics actions. The CONN param will be used to execute the optional connection request diagnostics and included by default. Add a conn-skip flag to the diagnostics command that will not send the CONN param so request diagnostics are skipped.
Why is it important?
Connection request diagnostics are optional when collecting diagnostics bundles, but should be included by default.
An example of these hooks being added is in fleet-server: elastic/fleet-server#3587
Adding the hooks to elastic-agent or the underlying beats will be done in a separate PR
Checklist
I have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature works./changelog/fragments
using the changelog toolHow to test this PR locally
Replace fleet-server component before installing/enrolling with one built from elastic/fleet-server#3587
Install/enroll the agent in a policy with fleet-server
run
sudo elastic-agent diagnostics [--skip-conn]
Related issues