|
19 | 19 | from opentelemetry.instrumentation.aio_pika.callback_decorator import ( |
20 | 20 | CallbackDecorator, |
21 | 21 | ) |
| 22 | +from opentelemetry.semconv._incubating.attributes.messaging_attributes import ( |
| 23 | + MESSAGING_MESSAGE_ID, |
| 24 | + MESSAGING_OPERATION, |
| 25 | + MESSAGING_SYSTEM, |
| 26 | +) |
| 27 | +from opentelemetry.semconv._incubating.attributes.net_attributes import ( |
| 28 | + NET_PEER_NAME, |
| 29 | + NET_PEER_PORT, |
| 30 | +) |
22 | 31 | from opentelemetry.semconv.trace import SpanAttributes |
23 | 32 | from opentelemetry.trace import SpanKind, get_tracer |
24 | 33 |
|
|
30 | 39 | EXCHANGE_NAME, |
31 | 40 | MESSAGE, |
32 | 41 | MESSAGE_ID, |
33 | | - MESSAGING_SYSTEM, |
| 42 | + MESSAGING_SYSTEM_VALUE, |
34 | 43 | QUEUE_NAME, |
35 | 44 | SERVER_HOST, |
36 | 45 | SERVER_PORT, |
|
40 | 49 | @skipIf(AIOPIKA_VERSION_INFO >= (8, 0), "Only for aio_pika 7") |
41 | 50 | class TestInstrumentedQueueAioRmq7(TestCase): |
42 | 51 | EXPECTED_ATTRIBUTES = { |
43 | | - SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM, |
| 52 | + MESSAGING_SYSTEM: MESSAGING_SYSTEM_VALUE, |
44 | 53 | SpanAttributes.MESSAGING_DESTINATION: EXCHANGE_NAME, |
45 | | - SpanAttributes.NET_PEER_NAME: SERVER_HOST, |
46 | | - SpanAttributes.NET_PEER_PORT: SERVER_PORT, |
47 | | - SpanAttributes.MESSAGING_MESSAGE_ID: MESSAGE_ID, |
| 54 | + NET_PEER_NAME: SERVER_HOST, |
| 55 | + NET_PEER_PORT: SERVER_PORT, |
| 56 | + MESSAGING_MESSAGE_ID: MESSAGE_ID, |
48 | 57 | SpanAttributes.MESSAGING_CONVERSATION_ID: CORRELATION_ID, |
49 | | - SpanAttributes.MESSAGING_OPERATION: "receive", |
| 58 | + MESSAGING_OPERATION: "receive", |
50 | 59 | } |
51 | 60 |
|
52 | 61 | def setUp(self): |
@@ -80,13 +89,13 @@ def test_decorate_callback(self): |
80 | 89 | @skipIf(AIOPIKA_VERSION_INFO <= (8, 0), "Only for aio_pika 8") |
81 | 90 | class TestInstrumentedQueueAioRmq8(TestCase): |
82 | 91 | EXPECTED_ATTRIBUTES = { |
83 | | - SpanAttributes.MESSAGING_SYSTEM: MESSAGING_SYSTEM, |
| 92 | + MESSAGING_SYSTEM: MESSAGING_SYSTEM_VALUE, |
84 | 93 | SpanAttributes.MESSAGING_DESTINATION: EXCHANGE_NAME, |
85 | | - SpanAttributes.NET_PEER_NAME: SERVER_HOST, |
86 | | - SpanAttributes.NET_PEER_PORT: SERVER_PORT, |
87 | | - SpanAttributes.MESSAGING_MESSAGE_ID: MESSAGE_ID, |
| 94 | + NET_PEER_NAME: SERVER_HOST, |
| 95 | + NET_PEER_PORT: SERVER_PORT, |
| 96 | + MESSAGING_MESSAGE_ID: MESSAGE_ID, |
88 | 97 | SpanAttributes.MESSAGING_CONVERSATION_ID: CORRELATION_ID, |
89 | | - SpanAttributes.MESSAGING_OPERATION: "receive", |
| 98 | + MESSAGING_OPERATION: "receive", |
90 | 99 | } |
91 | 100 |
|
92 | 101 | def setUp(self): |
|
0 commit comments