sentry-python
sentry-python copied to clipboard
Add simple scope management whenever a context is attached
- create a new otel context
_SCOPES_KEYthat will hold a tuple of(curent_scope, isolation_scope) - the
current_scopewill always be forked (like on every span creation/context update in practice)- note that this is on
attach, so not on all copy-on-write context object creation but only on apis such astrace.use_spanortracer.start_as_current_span - basically every otel
contextfork corresponds to ourcurrent_scopefork
- note that this is on
- the
isolation_scopecurrently will not be forked- these will later be updated, for instance when we update our top level scope apis that fork isolation scope, that will also have a corresponding change in this
attachfunction
- these will later be updated, for instance when we update our top level scope apis that fork isolation scope, that will also have a corresponding change in this
Codecov Report
Attention: Patch coverage is 27.27273% with 8 lines in your changes missing coverage. Please review.
Project coverage is 79.27%. Comparing base (
4f9257d) to head (436626b).
Additional details and impacted files
@@ Coverage Diff @@
## potel-base #3159 +/- ##
==============================================
- Coverage 79.30% 79.27% -0.04%
==============================================
Files 134 134
Lines 14248 14255 +7
Branches 2989 2990 +1
==============================================
Hits 11300 11300
- Misses 2101 2107 +6
- Partials 847 848 +1
| Files | Coverage Δ | |
|---|---|---|
| .../integrations/opentelemetry/contextvars_context.py | 42.85% <27.27%> (-28.58%) |
:arrow_down: |