Skip to content

Commit b09d094

Browse files
committed
Checking if context is valid.
1 parent dbb22e4 commit b09d094

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry_sdk/integrations/opentelemetry/propagator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def inject(self, carrier, context=None, setter=default_setter):
9090
context = get_current()
9191

9292
current_span = trace.get_current_span(context)
93+
94+
if not current_span.context.is_valid:
95+
return
96+
9397
span_id = trace.format_span_id(current_span.context.span_id)
9498

9599
span_map = SentrySpanProcessor().otel_span_map

0 commit comments

Comments
 (0)