diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py index 61a36d0c1..6121723f8 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/attribute_propagating_span_processor.py @@ -66,9 +66,9 @@ def on_start(self, span: Span, parent_context: Optional[Context] = None) -> None if is_local_root(span): if not _is_server_kind(span): propagation_data = self._propagation_data_extractor(span) - elif _is_server_kind(parent_span): + elif parent_span and _is_server_kind(parent_span): propagation_data = self._propagation_data_extractor(parent_span) - else: + elif parent_span: propagation_data = parent_span.attributes.get(self._propagation_data_key) if propagation_data is not None: