feat: add support to disable libbeat processors and providers auto init
Proposed commit message
some consumers of libbeat use only a very tiny amount of processors/providers so they have no need for the full list imported by libbeat.
This is especially problematic when processors depend on problematic library causing DCE (dead code elimination) to be disabled and significantly increasing binary size.
add a build tag to allow downstream applications to disable imports and manually init relevant processors/providers
Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have made corresponding change to the default configuration files
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added an entry in
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.
Disruptive User Impact
Author's Checklist
- [ ]
How to test this PR locally
Related issues
- Related to https://github.com/elastic/cloudbeat/issues/3586
Use cases
Screenshots
Logs
:robot: GitHub comments
Expand to view the GitHub comments
Just comment with:
rundocs-build: Re-trigger the docs validation. (use unformatted text in the comment!)
This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @kruskall? 🙏. For such, you'll need to label your PR with:
- The upcoming major version of the Elastic Stack
- The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)
To fixup this pull request, you need to add the backport labels for the needed branches, such as:
backport-8./dis the label to automatically backport to the8./dbranch./dis the digitbackport-active-allis the label that automatically backports to all active branches.backport-active-8is the label that automatically backports to all active minor branches for the 8 major.backport-active-9is the label that automatically backports to all active minor branches for the 9 major.
@kruskall, the PR looks good. One thing I'm missing (non blocker) is some documentation about this new build tag. I'm not quite sure the best place to document it :/.
As a consumer of libbeat, is there a place you'd look for documentation about this build tag? Maybe a note on /libbeat/README.md?
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)
@kruskall should we merge that one?