Skip to content

Commit 1fae4bb

Browse files
authored
Fix a small issue with None-type input on span name (#35)
*Issue #, if available:* If input a None type of span name, it will trigger an exception *Description of changes:* add a validate step to handle none type span name By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 928a5be commit 1fae4bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_span_processing_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _is_sqs_receive_message_consumer_span(span: ReadableSpan) -> bool:
102102
instrumentation_scope: InstrumentationScope = span.instrumentation_scope
103103

104104
return (
105-
_SQS_RECEIVE_MESSAGE_SPAN_NAME.casefold() == span.name.casefold()
105+
(span.name is not None and _SQS_RECEIVE_MESSAGE_SPAN_NAME.casefold() == span.name.casefold())
106106
and SpanKind.CONSUMER == span.kind
107107
and instrumentation_scope is not None
108108
and instrumentation_scope.name.startswith(_AWS_SDK_INSTRUMENTATION_SCOPE_PREFIX)

0 commit comments

Comments
 (0)