Skip to content

Update OTLP examples to use opentelemetry-appender-tracing, with filtering of the events from specific crates. #1798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2024

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented May 22, 2024

Fixes #1797
Design discussion issue (if applicable) #

Changes

Please provide a brief description of the changes here.

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)

@lalitb lalitb requested a review from a team May 22, 2024 01:26
@lalitb lalitb changed the title Update OTLP Examples use opentelemetry-appender-tracing, with filtering of the events from specific crates. Update OTLP examples to use opentelemetry-appender-tracing, with filtering of the events from specific crates. May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.5%. Comparing base (d08a861) to head (5a1dc12).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1798     +/-   ##
=======================================
- Coverage   73.6%   73.5%   -0.1%     
=======================================
  Files        124     124             
  Lines      19482   19482             
=======================================
- Hits       14341   14338      -3     
- Misses      5141    5144      +3     

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

@@ -91,9 +93,21 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
let logger_provider = init_logs().unwrap();

// Create a new OpenTelemetryLogBridge using the above LoggerProvider.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Create a new OpenTelemetryLogBridge using the above LoggerProvider.
// Create a new OpenTelemetryTracingBridge using the above LoggerProvider.

log::set_max_level(Level::Info.to_level_filter());
let layer = OpenTelemetryTracingBridge::new(&logger_provider);

// add a tracing filter to filter the events generated from the crates used by opentelemetry-otlp
Copy link
Member

Choose a reason for hiding this comment

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

please add a link to the tracking issue, and also warn that, the events from this layer will be filtered for this layer irrespective of if they occur inside OTLP Exporting or not, potentially leading to blind spots.

@cijothomas cijothomas merged commit d3b3f70 into open-telemetry:main May 22, 2024
21 of 22 checks passed
cijothomas pushed a commit that referenced this pull request May 22, 2024
lalitb added a commit to lalitb/opentelemetry-rust that referenced this pull request May 23, 2024
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.

Prevents logs from own operation
2 participants