We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c6ac09 commit 1b5b3f7Copy full SHA for 1b5b3f7
sentry_sdk/tracing.py
@@ -1228,9 +1228,11 @@ def __init__(
1228
if otel_span is not None:
1229
self._otel_span = otel_span
1230
else:
1231
- skip_span = (
1232
- only_if_parent and not get_current_span().get_span_context().is_valid
1233
- )
+ skip_span = False
+ if only_if_parent:
+ parent_span_context = get_current_span().get_span_context()
1234
+ skip_span = not parent_span_context.is_valid or parent_span_context.is_remote
1235
+
1236
if skip_span:
1237
self._otel_span = INVALID_SPAN
1238
0 commit comments