Skip to content

Commit b739af2

Browse files
committed
set destination name only if not phone number
Signed-off-by: emdneto <[email protected]>
1 parent d7bc137 commit b739af2

File tree

2 files changed

+4
-9
lines changed
  • instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions

2 files changed

+4
-9
lines changed

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ def extract_attributes(
8181
)
8282
attributes[SpanAttributes.MESSAGING_DESTINATION] = destination_name
8383

84-
# TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when opentelemetry-semantic-conventions 0.42b0 is released
85-
attributes["messaging.destination.name"] = cls._extract_input_arn(
86-
call_context
87-
)
84+
if not is_phone_number:
85+
attributes[SpanAttributes.MESSAGING_DESTINATION_NAME] = (
86+
cls._extract_input_arn(call_context)
87+
)
8888
call_context.span_name = (
8989
f"{'phone_number' if is_phone_number else destination_name} send"
9090
)

tox.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,6 @@ test_deps =
421421
opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
422422
opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
423423
opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
424-
pass_env =
425-
AWS_ACCESS_KEY_ID
426-
AWS_SECRET_ACCESS_KEY
427-
AWS_SESSION_TOKEN
428-
AWS_DEFAULT_REGION
429424

430425
deps =
431426
lint: -r dev-requirements.txt

0 commit comments

Comments
 (0)