Skip to content

Commit

Permalink
Update hub to get trace information from current scope
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Feb 21, 2024
1 parent e4febed commit 5622978
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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()
Expand All @@ -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,
)

Expand All @@ -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,
)

Expand Down

0 comments on commit 5622978

Please sign in to comment.