From 5622978d14173ad831b5532c6666e85daef14358 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Wed, 21 Feb 2024 16:32:50 +0100 Subject: [PATCH] Update hub to get trace information from current scope --- sentry_sdk/hub.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sentry_sdk/hub.py b/sentry_sdk/hub.py index 1d38bce5f8..9bb65fe1e1 100644 --- a/sentry_sdk/hub.py +++ b/sentry_sdk/hub.py @@ -695,7 +695,7 @@ def get_traceparent(self): Returns the traceparent either from the active span or from the scope. """ - return Scope.get_isolation_scope().get_traceparent() + return Scope.get_current_scope().get_traceparent() def get_baggage(self): # type: () -> Optional[str] @@ -706,7 +706,7 @@ def get_baggage(self): Returns Baggage either from the active span or from the scope. """ - baggage = Scope.get_isolation_scope().get_baggage() + baggage = Scope.get_current_scope().get_baggage() if baggage is not None: return baggage.serialize() @@ -724,7 +724,7 @@ def iter_trace_propagation_headers(self, span=None): from the span representing the request, if available, or the current span on the scope if not. """ - return Scope.get_isolation_scope().iter_trace_propagation_headers( + return Scope.get_current_scope().iter_trace_propagation_headers( span=span, ) @@ -743,7 +743,7 @@ def trace_propagation_meta(self, span=None): "The parameter `span` in trace_propagation_meta() is deprecated and will be removed in the future." ) - return Scope.get_isolation_scope().trace_propagation_meta( + return Scope.get_current_scope().trace_propagation_meta( span=span, )