Skip to content

Commit

Permalink
If spans/transactions are started through the hub, also use the curre…
Browse files Browse the repository at this point in the history
…nt scope
  • Loading branch information
antonpirker committed Feb 21, 2024
1 parent dbf3694 commit a842bbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def start_span(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
"""
scope = Scope.get_isolation_scope()
scope = Scope.get_current_scope()
return scope.start_span(instrumenter=instrumenter, **kwargs)

def start_transaction(
Expand Down Expand Up @@ -494,7 +494,7 @@ def start_transaction(
For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Transaction`.
"""
scope = Scope.get_isolation_scope()
scope = Scope.get_current_scope()

# For backwards compatibility, we allow passing the scope as the hub.
# We need a major release to make this nice. (if someone searches the code: deprecated)
Expand Down

0 comments on commit a842bbe

Please sign in to comment.