Skip to content

Commit c7afdd9

Browse files
committed
get rid of conversation kind which is deprecated and fix some more imports
1 parent ed07904 commit c7afdd9

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@
4444
)
4545
from opentelemetry.propagators.textmap import CarrierT, Getter, Setter
4646
from opentelemetry.semconv._incubating.attributes.messaging_attributes import (
47-
MESSAGING_CONVERSATION_ID,
48-
MESSAGING_DESTINATION,
49-
MESSAGING_DESTINATION_KIND,
47+
MESSAGING_DESTINATION_NAME,
48+
MESSAGING_MESSAGE_CONVERSATION_ID,
5049
MESSAGING_MESSAGE_ID,
5150
MESSAGING_OPERATION,
5251
MESSAGING_SYSTEM,
53-
MESSAGING_URL,
52+
)
53+
from opentelemetry.semconv._incubating.attributes.server_attributes import (
54+
SERVER_ADDRESS,
5455
)
5556
from opentelemetry.semconv.trace import (
56-
MessagingDestinationKindValues,
5757
MessagingOperationValues,
5858
)
5959
from opentelemetry.trace import Link, Span, SpanKind, Tracer, TracerProvider
@@ -160,17 +160,15 @@ def _enrich_span(
160160
if not span.is_recording():
161161
return
162162
span.set_attribute(MESSAGING_SYSTEM, "aws.sqs")
163-
span.set_attribute(MESSAGING_DESTINATION, queue_name)
164-
span.set_attribute(
165-
MESSAGING_DESTINATION_KIND,
166-
MessagingDestinationKindValues.QUEUE.value,
167-
)
168-
span.set_attribute(MESSAGING_URL, queue_url)
163+
span.set_attribute(MESSAGING_DESTINATION_NAME, queue_name)
164+
span.set_attribute(SERVER_ADDRESS, queue_url)
169165

170166
if operation:
171167
span.set_attribute(MESSAGING_OPERATION, operation.value)
172168
if conversation_id:
173-
span.set_attribute(MESSAGING_CONVERSATION_ID, conversation_id)
169+
span.set_attribute(
170+
MESSAGING_MESSAGE_CONVERSATION_ID, conversation_id
171+
)
174172
if message_id:
175173
span.set_attribute(MESSAGING_MESSAGE_ID, message_id)
176174

instrumentation/opentelemetry-instrumentation-boto3sqs/tests/test_boto3sqs_instrumentation.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@
2828
Boto3SQSSetter,
2929
)
3030
from opentelemetry.semconv._incubating.attributes.messaging_attributes import (
31-
MESSAGING_DESTINATION,
32-
MESSAGING_DESTINATION_KIND,
31+
MESSAGING_DESTINATION_NAME,
3332
MESSAGING_MESSAGE_ID,
3433
MESSAGING_OPERATION,
3534
MESSAGING_SYSTEM,
36-
MESSAGING_URL,
3735
)
38-
from opentelemetry.semconv.trace import (
39-
MessagingDestinationKindValues,
40-
MessagingOperationValues,
36+
from opentelemetry.semconv._incubating.attributes.server_attributes import (
37+
SERVER_ADDRESS,
4138
)
39+
from opentelemetry.semconv.trace import MessagingOperationValues
4240
from opentelemetry.test.test_base import TestBase
4341
from opentelemetry.trace import SpanKind
4442
from opentelemetry.trace.span import Span, format_span_id, format_trace_id
@@ -231,9 +229,8 @@ def _assert_injected_span(self, msg_attrs: Dict[str, Any], span: Span):
231229
def _default_span_attrs(self):
232230
return {
233231
MESSAGING_SYSTEM: "aws.sqs",
234-
MESSAGING_DESTINATION: self._queue_name,
235-
MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value,
236-
MESSAGING_URL: self._queue_url,
232+
MESSAGING_DESTINATION_NAME: self._queue_name,
233+
SERVER_ADDRESS: self._queue_url,
237234
}
238235

239236
@staticmethod

0 commit comments

Comments
 (0)