beats icon indicating copy to clipboard operation
beats copied to clipboard

feat: add support to disable libbeat processors and providers auto init

Open kruskall opened this issue 3 months ago • 5 comments

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.asciidoc or CHANGELOG-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

kruskall avatar Sep 16 '25 01:09 kruskall

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

github-actions[bot] avatar Sep 16 '25 01:09 github-actions[bot]

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./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

mergify[bot] avatar Sep 16 '25 01:09 mergify[bot]

@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?

belimawr avatar Sep 16 '25 12:09 belimawr

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar Dec 08 '25 07:12 elasticmachine

@kruskall should we merge that one?

pierrehilbert avatar Dec 08 '25 07:12 pierrehilbert