Skip to content

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented May 19, 2025

  • If a TracerProvider already exists, patch it. TracerProvider is a singleton, so if we aren't the first ones setting it up, we need to use the existing one.
    • In tests, reset TracerProvider after each test so that we start with a clean slate and it gets set up anew on init.
  • If an OTel span starts, record its instrumentation_scope.name (e.g. opentelemetry.instrumentation.flask) and turn it into origin at the end. This allows us to differentiate between spans auto-instrumented by Sentry and OTel.

Copy link

codecov bot commented May 19, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.85%. Comparing base (f5fb6e7) to head (8c7c46a).
⚠️ Report is 215 commits behind head on potel-base.

Files with missing lines Patch % Lines
sentry_sdk/opentelemetry/span_processor.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           potel-base    #4401      +/-   ##
==============================================
+ Coverage       84.80%   84.85%   +0.05%     
==============================================
  Files             144      144              
  Lines           14728    14740      +12     
  Branches         2343     2345       +2     
==============================================
+ Hits            12490    12508      +18     
+ Misses           1523     1515       -8     
- Partials          715      717       +2     
Files with missing lines Coverage Δ
sentry_sdk/opentelemetry/tracing.py 100.00% <100.00%> (ø)
sentry_sdk/tracing.py 79.64% <ø> (-0.71%) ⬇️
sentry_sdk/opentelemetry/span_processor.py 82.55% <75.00%> (+0.41%) ⬆️

... and 4 files with indirect coverage changes

@sentrivana sentrivana closed this Sep 12, 2025
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.

1 participant