-
Notifications
You must be signed in to change notification settings - Fork 527
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
Relocate libbeat output & instrumentation #9247
Conversation
This pull request does not have a backport label. Could you fix it @axw? 🙏
NOTE: |
736635a
to
03f4125
Compare
📚 Go benchmark reportDiff with the
report generated with https://pkg.go.dev/golang.org/x/perf/cmd/benchstat |
27b4e88
to
188a8f5
Compare
This is something that should run just once for the lifetime of the process. I'm intending to move the reload logic out of beater and into beatcmd (or a subpackage).
Move initialisation of libbeat output (publisher/pipeline) and instrumentation (APM tracer) to package beater. Some of the complexity around reloading is reduced as now have full control over creating the libbeat output. Similarly, we can reduce complexity related to the "tracer server" by running it per reloaded server.
188a8f5
to
3669a35
Compare
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.
The seperation into beatcmd
and beater
makes this much more readable. Only left one question ..
ctx, reload.ReloadableFunc(reloader.reloadOutput), | ||
) | ||
}) | ||
reload.Register.MustRegister("output", reload.ReloadableFunc(reloader.reloadOutput)) |
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.
Why was this done in its own go routine before (and is not necessary anymore)?
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.
Previously libbeat registered the reloader, and we added our own reloader. IIRC there was a timing issue that meant we had to register the hook before the "reloader" was created. So what we did was created a channel, and then received requests off that channel after starting the server.
We no longer handle output reloading in libbeat or in beatcmd, so we can simplify it all.
Motivation/summary
Move the automaxprocs adjustment code to package beatcmd, since it should run only once for the process's lifetime. Move creation of the libbeat output pipeline, and APM instrumentation, to package beater, as these can both be reloaded/reconfigured.
Checklist
- [ ] Update CHANGELOG.asciidoc- [ ] Update package changelog.yml (only if changes toapmpackage
have been made)- [ ] Documentation has been updatedHow to test these changes
N/A
Related issues
Part of #8928
Closes #9074