fix(otel): fix beatprocessor to honor when conditions#50555
fix(otel): fix beatprocessor to honor when conditions#50555mauri870 merged 3 commits intoelastic:mainfrom
when conditions#50555Conversation
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.
🤖 GitHub commentsJust comment with:
|
53f36f7 to
ff1a252
Compare
125b907 to
305a1ab
Compare
when conditions
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR fixes a bug where the OTel Beat processor was ignoring 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Mergifyio backport 8.19 9.3 9.4 |
✅ Backports have been createdDetails
Cherry-pick of 7bbe8ee has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Cherry-pick of 7bbe8ee has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
|
) * 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) Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
…conditions (#50559) * fix(otel): fix beatprocessor to honor `when` conditions (#50555) * 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) # Conflicts: # x-pack/otel/processor/beatprocessor/processor.go * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
…onditions (#50560) * fix(otel): fix beatprocessor to honor `when` conditions (#50555) * 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) # Conflicts: # x-pack/otel/processor/beatprocessor/processor.go * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
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
whenfield was unpacked into the config but silently dropped, so processors ran unconditionally.Wrap each constructor with
processors.NewConditionalbefore invoking it so conditionals are honored, matching the behavior of standalone beats.Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.How to test this PR locally
Related issues