-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add registry to Filebeat's diagnostic #41795
base: main
Are you sure you want to change the base?
Add registry to Filebeat's diagnostic #41795
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
…try-on-diagnostics
…try-on-diagnostics
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
I'll implement those changes. |
The Fleet server upload API used to get diagnostics as an action probably has a limit, I'm not sure what it is by default off the top of my head. I would expect it is ~100 MB so if we go with 20 MB we need to make sure we don't push ourselves past that in real use cases. The few compressed gzipped diagnostics I have laying around are all <5 MB now for reference. |
The Fleet settings aren't super clear on what the upload file size limit is, maybe there isn't one? The files are chunked as part of the implementation. https://github.com/elastic/fleet-server/blob/4132a505f0c759e332a890fdf701b8ff238cf91a/fleet-server.reference.yml#L200-L214 |
…try-on-diagnostics
This pull request is now in conflicts. Could you fix it? 🙏
|
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 apart from comments
filebeat/input/v2/compat/compat.go
Outdated
// func (r *runner) Diagnostics() []diagnostics.DiagnosticSetup { | ||
// fmt.Println("================================================== Diagnostics called!") | ||
// setup := diagnostics.DiagnosticSetup{ | ||
// Name: "registry collector", | ||
// Description: "Collect Filebeat's registry", | ||
// Filename: "registry.tar.gz", | ||
// ContentType: "application/octet-stream", | ||
// Callback: getRegistry, | ||
// } | ||
|
||
// return []diagnostics.DiagnosticSetup{setup} | ||
// } | ||
|
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.
I don't think we need this commented out code. Correct?
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.
Requesting changes until comments get addressed.
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.Related issues
## Use cases## ScreenshotsLogs
Full log entries
Only the
message
field: