File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
instrumentation/opentelemetry-instrumentation-botocore
src/opentelemetry/instrumentation/botocore/extensions Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ def extract_attributes(
8181 ] = MessagingDestinationKindValues .TOPIC .value
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 (call_context )
8486 call_context .span_name = (
8587 f"{ 'phone_number' if is_phone_number else destination_name } send"
8688 )
Original file line number Diff line number Diff line change @@ -118,6 +118,12 @@ def _test_publish_to_arn(self, arg_name: str):
118118 self .topic_name ,
119119 span .attributes [SpanAttributes .MESSAGING_DESTINATION ],
120120 )
121+ self .assertEqual (
122+ target_arn ,
123+ # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when
124+ # opentelemetry-semantic-conventions 0.42b0 is released
125+ span .attributes ["messaging.destination.name" ]
126+ )
121127
122128 @mock_sns
123129 def test_publish_to_phone_number (self ):
@@ -184,6 +190,12 @@ def test_publish_batch_to_topic(self):
184190 self .topic_name ,
185191 span .attributes [SpanAttributes .MESSAGING_DESTINATION ],
186192 )
193+ self .assertEqual (
194+ topic_arn ,
195+ # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when
196+ # opentelemetry-semantic-conventions 0.42b0 is released
197+ span .attributes ["messaging.destination.name" ]
198+ )
187199
188200 self .assert_injected_span (message1_attrs , span )
189201 self .assert_injected_span (message2_attrs , span )
You can’t perform that action at this time.
0 commit comments