Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading