Skip to content

Commit

Permalink
Fix remote case for only_if_parent (#3777)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py authored Nov 14, 2024
1 parent 6c6ac09 commit 0011e22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,9 +1228,11 @@ def __init__(
if otel_span is not None:
self._otel_span = otel_span
else:
skip_span = (
only_if_parent and not get_current_span().get_span_context().is_valid
)
skip_span = False
if only_if_parent:
parent_span_context = get_current_span().get_span_context()
skip_span = not parent_span_context.is_valid or parent_span_context.is_remote

if skip_span:
self._otel_span = INVALID_SPAN
else:
Expand Down

0 comments on commit 0011e22

Please sign in to comment.