[8.x](backport #41795) Add registry to Filebeat's diagnostic #42413
+653
−1
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.
Proposed commit message
This commit adds Filebeat's registry folder to the Elastic-Agent
diagnostics. It's called
registry.tar.gz
and includes all registry fileson
${path.home}/registry
.The registry is first archived into a temporary tar file. The
temporary file is created by calling
os.CreateTemp
and will use theOS's temporary folder. Then it's gziped in memory and returned to
Elastic-Agent, finally the temporary file is removed from the disk.
If the final gziped file is more than 20mb, it is skipped due to its large
size.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
None.
Author's Checklist
How to test this PR locally
The easiest way to test it locally is to package the Elastic-Agent with your local build of Beats by setting
EXTERNAL=false
when callingmage build
in the Elastic-Agent folder.Then, deploy the Elastic-Agent, let it ingest some logs and request the diagnostics. Extract the diagnostics and look for
registry.tar.gz
incomponents/filestram-*
folders.You can also run the integration tests:
Related issues
## Use cases## ScreenshotsLogs
Full log entries
Only the
message
field: