Skip to content

[9.4](backport #50555) fix(otel): fix beatprocessor to honor when conditions#50561

Merged
mauri870 merged 1 commit into9.4from
mergify/bp/9.4/pr-50555
May 8, 2026
Merged

[9.4](backport #50555) fix(otel): fix beatprocessor to honor when conditions#50561
mauri870 merged 1 commit into9.4from
mergify/bp/9.4/pr-50555

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 7, 2026

Proposed commit message

The beat processor instantiated each processor by calling its New constructor directly, bypassing the conditional wrapping that processors.Namespace.Register applies on the standard libbeat path. The when field was unpacked into the config but silently dropped, so processors ran unconditionally.

Wrap each constructor with processors.NewConditional before invoking it so conditionals are honored, matching the behavior of standalone beats.

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

go test -count=1 -v -run '^TestCreateProcessor$' ./x-pack/otel/processor/beatprocessor/
go test -count=1 -tags=integration -v -run '^TestBeatProcessorWhenCondition$' ./x-pack/filebeat/tests/integration/

./script/stresstest.sh ./x-pack/otel/processor/beatprocessor '^TestCreateProcessor$' -p 4
2m10s: 17012 runs so far, 0 failures, 4 active

./script/stresstest.sh --tags integration ./x-pack/filebeat/tests/integration '^TestBeatProcessorWhenCondition$' -p 2
3m10s: 683 runs so far, 0 failures, 2 active

Related issues

* otel(beatprocessor): honor  conditions on inner Beat processors

The beat processor instantiated each processor by calling
its New constructor directly, bypassing the conditional wrapping
that processors.Namespace.Register applies on the standard libbeat
path. The `when` field was unpacked into the config but silently
dropped, so processors ran unconditionally.

Wrap each constructor with `processors.NewConditional` before invoking
it so `when` configuration is honored, matching the behavior of
standalone beats.

* add changelog

* better wording

(cherry picked from commit 7bbe8ee)
@mergify mergify Bot added the backport label May 7, 2026
@mergify mergify Bot requested a review from a team as a code owner May 7, 2026 21:40
@mergify mergify Bot requested review from AndersonQ and belimawr and removed request for a team May 7, 2026 21:40
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 7, 2026
@github-actions github-actions Bot added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix labels May 7, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 7, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mauri870 mauri870 merged commit 471eefb into 9.4 May 8, 2026
54 checks passed
@mauri870 mauri870 deleted the mergify/bp/9.4/pr-50555 branch May 8, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bugfix Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant