Skip to content

Conversation

@stefanobaghino
Copy link
Contributor

Fixes #2759

Changes

The approach suggested here by @scottgerring has been implemented:

Something along these lines perhaps:

 #[derive(Debug)]
  pub struct EnrichmentProcessor<P: LogProcessor> {
      /// The wrapped processor that will receive enriched log records
      next: P,
  }

impl<P: LogProcessor> LogProcessor for EnrichmentProcessor<P> {
     #[cfg(feature = "spec_unstable_logs_enabled")]
      fn event_enabled(&self, level: Severity, target: &str, name: Option<&str>) -> bool {
          // Delegate to wrapped processor
          self.next.event_enabled(level, target, name)
      }

}

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.7%. Comparing base (627f252) to head (42d0340).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3266   +/-   ##
=====================================
  Coverage   80.7%   80.7%           
=====================================
  Files        129     129           
  Lines      23210   23210           
=====================================
  Hits       18748   18748           
  Misses      4462    4462           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefanobaghino stefanobaghino marked this pull request as ready for review November 25, 2025 15:35
@stefanobaghino stefanobaghino requested a review from a team as a code owner November 25, 2025 15:35
@stefanobaghino
Copy link
Contributor Author

I haven't seen any changelog entry for examples, but do let me know if I should add something to the changelog.

@scottgerring
Copy link
Member

Hey @stefanobaghino thanks for raising this!
ACK Cijo's comments above; you'll also need to format, but otherwise seems good to me

@stefanobaghino
Copy link
Contributor Author

Hey @stefanobaghino thanks for raising this! ACK Cijo's comments above; you'll also need to format, but otherwise seems good to me

Thanks for pointing that out to me, formatting addressed in a446807 (and I checked again after addressing @cijothomas's comments).

stefanobaghino added a commit to stefanobaghino/opentelemetry-rust that referenced this pull request Dec 4, 2025
stefanobaghino added a commit to stefanobaghino/opentelemetry-rust that referenced this pull request Dec 4, 2025
@stefanobaghino stefanobaghino force-pushed the stefanobaghino/2759-logs-enrichment-example branch from 1b96b67 to cd75428 Compare December 4, 2025 06:45
@stefanobaghino stefanobaghino force-pushed the stefanobaghino/2759-logs-enrichment-example branch from cd75428 to 8da1410 Compare December 4, 2025 06:49
name = "logs-advanced"
path = "src/main.rs"
bench = false
required-features = ["spec_unstable_logs_enabled"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we just merged a PR that removes this feature flag. The feature is stable and now does not require feature flags. Could you update to reflect it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged with main in 013c15f, feature flag removed in 4ee58a3.

@cijothomas cijothomas merged commit 65969fd into open-telemetry:main Dec 5, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document (with example) how EnrichmentProcessor must be authored without sacrificing performance in Log pipeline

3 participants