Skip to content

Conversation

@sl0thentr0py
Copy link
Member

All our integrations follow the setup_once logic while the otel patching was being done for each Client again leading to recursive patching.
This was revealed by removing the transport test forks.

@sl0thentr0py sl0thentr0py requested a review from a team as a code owner July 17, 2025 16:21
@sl0thentr0py sl0thentr0py requested a review from sentrivana July 17, 2025 16:21
@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.90%. Comparing base (dbb8ead) to head (cab4fcc).
Report is 1 commits behind head on potel-base.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff               @@
##           potel-base    #4595      +/-   ##
==============================================
- Coverage       84.94%   84.90%   -0.05%     
==============================================
  Files             158      158              
  Lines           15369    15372       +3     
  Branches         2430     2431       +1     
==============================================
- Hits            13055    13051       -4     
- Misses           1560     1567       +7     
  Partials          754      754              
Files with missing lines Coverage Δ
sentry_sdk/opentelemetry/tracing.py 91.89% <100.00%> (+0.71%) ⬆️

... and 2 files with indirect coverage changes

@sl0thentr0py sl0thentr0py force-pushed the neel/setup-otel-once branch from 09f785e to e1b6168 Compare July 17, 2025 16:29
@sl0thentr0py sl0thentr0py changed the title Setup opentelemetry patches only once Setup opentelemetry patch only once Jul 17, 2025
@sl0thentr0py sl0thentr0py force-pushed the neel/setup-otel-once branch from e1b6168 to 612888d Compare July 17, 2025 20:05
@sl0thentr0py sl0thentr0py force-pushed the neel/setup-otel-once branch from 612888d to cab4fcc Compare July 17, 2025 20:09
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

lgtm, but looks like it still could be possible for the opentelemetry readable span to be patched mutiple times in a multithreaded context if there is a race condition.

If it is possible that multiple threads would attempt the patch concurrently, we should make the code thread safe

@sl0thentr0py sl0thentr0py merged commit ef1b2af into potel-base Jul 18, 2025
124 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/setup-otel-once branch July 18, 2025 09:30
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.

3 participants