Skip to content

[9.3](backport #49518) perf(otel): share instance of Beat processor between pipelines#49570

Open
mergify[bot] wants to merge 1 commit into9.3from
mergify/bp/9.3/pr-49518
Open

[9.3](backport #49518) perf(otel): share instance of Beat processor between pipelines#49570
mergify[bot] wants to merge 1 commit into9.3from
mergify/bp/9.3/pr-49518

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Mar 19, 2026

Proposed commit message

Changes the implementation of the OTel Beat processor so that only a single instance is created for a single configuration. This is done by re-using sharedcomponent package from OpenTelemetry Collector (the package source had to be copied as it is a private package upstream, see open-telemetry/opentelemetry-collector#4266, open-telemetry/opentelemetry-collector#11622)).

Previously a separate instance was created for every pipeline the processor was used in.

This saves resources by avoiding duplicate instances of expensive Beat processors like add_kubernetes_metadata, etc.

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. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool.

How to test this PR locally

Build Elastic Agent with this change, run with a config similar to the one specified in the TestBeatProcessorSharedAcrossPipelines test in this PR.


This is an automatic backport of pull request #49518 done by [Mergify](https://mergify.com).

* feat(otel): share instance of Beat processor between pipelines

* test: refine test case

* refactor: move sharedcomponent package

* go mod tidy

* fix license header

(cherry picked from commit eff0889)
@mergify mergify bot requested a review from a team as a code owner March 19, 2026 12:38
@mergify mergify bot added the backport label Mar 19, 2026
@mergify mergify bot requested review from khushijain21 and leehinman and removed request for a team March 19, 2026 12:38
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 19, 2026
@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 19, 2026
@elasticmachine
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants