File tree 3 files changed +16
-0
lines changed
instrumentation/opentelemetry-instrumentation-botocore
src/opentelemetry/instrumentation/botocore/extensions
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
([ #1919 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1943 ) )
13
13
- ` opentelemetry-instrumentation-aiohttp-server ` Add instrumentor and auto instrumentation support for aiohttp-server
14
14
([ #1800 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800 ) )
15
+ - ` opentelemetry-instrumentation-botocore ` Include SNS topic ARN as a span attribute with name ` messaging.destination.name ` to uniquely identify the SNS topic
16
+ ([ #1995 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1995 ) )
15
17
- ` opentelemetry-instrumentation-system-metrics ` Add support for collecting process metrics
16
18
([ #1948 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1948 ) )
17
19
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ def extract_attributes(
81
81
] = MessagingDestinationKindValues .TOPIC .value
82
82
attributes [SpanAttributes .MESSAGING_DESTINATION ] = destination_name
83
83
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 )
84
86
call_context .span_name = (
85
87
f"{ 'phone_number' if is_phone_number else destination_name } send"
86
88
)
Original file line number Diff line number Diff line change @@ -118,6 +118,12 @@ def _test_publish_to_arn(self, arg_name: str):
118
118
self .topic_name ,
119
119
span .attributes [SpanAttributes .MESSAGING_DESTINATION ],
120
120
)
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
+ )
121
127
122
128
@mock_sns
123
129
def test_publish_to_phone_number (self ):
@@ -184,6 +190,12 @@ def test_publish_batch_to_topic(self):
184
190
self .topic_name ,
185
191
span .attributes [SpanAttributes .MESSAGING_DESTINATION ],
186
192
)
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
+ )
187
199
188
200
self .assert_injected_span (message1_attrs , span )
189
201
self .assert_injected_span (message2_attrs , span )
You can’t perform that action at this time.
0 commit comments