Skip to content

Commit 1b7d3fa

Browse files
fix: Avoid split propagation context on empty continue_trace()
1 parent 0527c03 commit 1b7d3fa

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

sentry_sdk/traces.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,13 @@ def continue_trace(incoming: "dict[str, Any]") -> None:
200200
# used to be set there in non-span-first mode. But in span first mode, we
201201
# start spans on the current scope, regardless of type, like JS does, so we
202202
# need to set the propagation context there.
203-
sentry_sdk.get_isolation_scope().generate_propagation_context(
204-
incoming,
205-
)
206-
sentry_sdk.get_current_scope().generate_propagation_context(
203+
isolation_scope = sentry_sdk.get_isolation_scope()
204+
current_scope = sentry_sdk.get_current_scope()
205+
206+
isolation_scope.generate_propagation_context(
207207
incoming,
208208
)
209+
current_scope._propagation_context = isolation_scope._propagation_context
209210

210211

211212
def new_trace() -> None:

0 commit comments

Comments
 (0)