We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af324dd commit 039b30bCopy full SHA for 039b30b
propagator/opentelemetry-propagator-jaeger/src/opentelemetry/propagators/jaeger/__init__.py
@@ -81,8 +81,8 @@ def inject(
81
if span_context == trace.INVALID_SPAN_CONTEXT:
82
return
83
84
- # NonRecordingSpans do not have a parent, set parent to 0 in this case
85
- span_parent_id = span.parent.span_id if hasattr(span, 'parent') and span.parent else 0
+ # Non-recording spans do not have a parent
+ span_parent_id = span.parent.span_id if span.is_recording() and span.parent else 0
86
trace_flags = span_context.trace_flags
87
if trace_flags.sampled:
88
trace_flags |= self.DEBUG_FLAG
0 commit comments