-
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
[debugPrintProcessor]: exit directly when log doesn't have debug level enabled #40081
[debugPrintProcessor]: exit directly when log doesn't have debug level enabled #40081
Conversation
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.
Good find!
IIUC this issue has been affecting agent since 8.7.0? (I stand corrected, I missed this conditional)
after looking around the git history, I think that the PR which caused this is this one as the older implementation had the encoding part under an if which was checking the log level. So only 8.15.0 is affected?! |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Thanks for catching that @pkoutsovasilis. |
For Elastic Agent this is 8.15.0 only, for standalone Beats this has been there since the beginning when it was first implemented: 83dfb2f When under agent it was gated by: https://github.com/elastic/beats/blob/cef7b39ee75b369eaaa9c1f992d151731c6da6d3/libbeat/management/agent.go#L50-L62 |
CC @alexsapran I would expect this to show up in the Filebeat benchmarks. |
You would be right to expect that. Unfortunately, this work is not yet complete. Running elastic-agent benchmarks was just unblocked from @pkoutsovasilis some days ago. |
with the opportunity of this PR I think it is a good idea to investigate if we can help in adding support to benchmark Filebeat inputs owned by @elastic/sec-deployment-and-devices @pierrehilbert @cmacknz should we wait for a review from @belimawr ? |
@belimawr will soon start his day so we can wait and get this merged today after his review if this is okay for you? |
Proposed commit message
This PR is the aftermath of profiling the netflow integration test of this PR (PS: the pcap I used as input is ~25MB thus I won't include it in beats repo)
So this is the cpu profile flamegraph before the commit of this PR
As we can see
debugPrintProcessor
is invoked and we pay the "performance" price of encoding every event in json even when our log isn't set up with DEBUG level.The respective cpu profile flamegraph after this PR with debugPrintProcessor still being there but exiting directly when log DEBUG is not enabled
Extracting the average EPS of the aformentioned netflow integration tested on my local macbook with a local ES inside a container
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
N/A
Author's Checklist
N/A
How to test this PR locally
Help get this PR merged or clone it and apply this small commit there 🙂
run go profiler against TestNetFlowIntegration
Related issues
Use cases
N/A
Screenshots
Look at description
Logs
N/A