Hi,
I'm encountering an error when creating an Otel span with ADOT
|
elif parent_span and _is_server_kind(parent_span): |
|
propagation_data = self._propagation_data_extractor(parent_span) |
When the parent_span isn't a ReadableSpan (e.g. a NonRecordingSpan), _is_server_kind would throw an attribute exception because the other types of span may not have the kind attribute.
My use case:
I'm using NonRecordingSpan to create a parent span placeholder, which will be filled later
context = SpanContext(
trace_id=self._id_generator.generate_trace_id(),
span_id=operation_id_to_span_id(parent_id),
is_remote=False,
)
placeholder_span = NonRecordingSpan(context)
parent_context = trace.set_span_in_context(
placeholder_span, self._extracted_context
)
span = self._tracer.start_span(
name=name,
attributes=attributes,
start_time=_to_otel_timestamp(start_time),
context=parent_context,
)
My workaround is to add the expected attributes to the NonRecordingSpan I created above:
placeholder_span.kind = SpanKind.INTERNAL
placeholder_span.attributes = {}
Hi,
I'm encountering an error when creating an Otel span with ADOT
aws-otel-python-instrumentation/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py
Lines 80 to 81 in 28fc34e
When the
parent_spanisn't aReadableSpan(e.g. aNonRecordingSpan),_is_server_kindwould throw an attribute exception because the other types of span may not have thekindattribute.My use case:
I'm using
NonRecordingSpanto create a parent span placeholder, which will be filled laterMy workaround is to add the expected attributes to the
NonRecordingSpanI created above: