2525 KafkaContextGetter ,
2626 KafkaContextSetter ,
2727)
28+ from opentelemetry .semconv ._incubating .attributes .messaging_attributes import (
29+ MESSAGING_MESSAGE_ID ,
30+ MESSAGING_OPERATION ,
31+ MESSAGING_SYSTEM ,
32+ )
2833from opentelemetry .semconv .trace import (
2934 MessagingDestinationKindValues ,
3035 SpanAttributes ,
@@ -122,36 +127,36 @@ def test_poll(self) -> None:
122127 {
123128 "name" : "topic-10 process" ,
124129 "attributes" : {
125- SpanAttributes . MESSAGING_OPERATION : "process" ,
130+ MESSAGING_OPERATION : "process" ,
126131 SpanAttributes .MESSAGING_KAFKA_PARTITION : 0 ,
127- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
132+ MESSAGING_SYSTEM : "kafka" ,
128133 SpanAttributes .MESSAGING_DESTINATION : "topic-10" ,
129134 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
130- SpanAttributes . MESSAGING_MESSAGE_ID : "topic-10.0.0" ,
135+ MESSAGING_MESSAGE_ID : "topic-10.0.0" ,
131136 },
132137 },
133138 {"name" : "recv" , "attributes" : {}},
134139 {
135140 "name" : "topic-20 process" ,
136141 "attributes" : {
137- SpanAttributes . MESSAGING_OPERATION : "process" ,
142+ MESSAGING_OPERATION : "process" ,
138143 SpanAttributes .MESSAGING_KAFKA_PARTITION : 2 ,
139- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
144+ MESSAGING_SYSTEM : "kafka" ,
140145 SpanAttributes .MESSAGING_DESTINATION : "topic-20" ,
141146 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
142- SpanAttributes . MESSAGING_MESSAGE_ID : "topic-20.2.4" ,
147+ MESSAGING_MESSAGE_ID : "topic-20.2.4" ,
143148 },
144149 },
145150 {"name" : "recv" , "attributes" : {}},
146151 {
147152 "name" : "topic-30 process" ,
148153 "attributes" : {
149- SpanAttributes . MESSAGING_OPERATION : "process" ,
154+ MESSAGING_OPERATION : "process" ,
150155 SpanAttributes .MESSAGING_KAFKA_PARTITION : 1 ,
151- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
156+ MESSAGING_SYSTEM : "kafka" ,
152157 SpanAttributes .MESSAGING_DESTINATION : "topic-30" ,
153158 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
154- SpanAttributes . MESSAGING_MESSAGE_ID : "topic-30.1.3" ,
159+ MESSAGING_MESSAGE_ID : "topic-30.1.3" ,
155160 },
156161 },
157162 {"name" : "recv" , "attributes" : {}},
@@ -190,8 +195,8 @@ def test_consume(self) -> None:
190195 {
191196 "name" : "topic-1 process" ,
192197 "attributes" : {
193- SpanAttributes . MESSAGING_OPERATION : "process" ,
194- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
198+ MESSAGING_OPERATION : "process" ,
199+ MESSAGING_SYSTEM : "kafka" ,
195200 SpanAttributes .MESSAGING_DESTINATION : "topic-1" ,
196201 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
197202 },
@@ -200,8 +205,8 @@ def test_consume(self) -> None:
200205 {
201206 "name" : "topic-2 process" ,
202207 "attributes" : {
203- SpanAttributes . MESSAGING_OPERATION : "process" ,
204- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
208+ MESSAGING_OPERATION : "process" ,
209+ MESSAGING_SYSTEM : "kafka" ,
205210 SpanAttributes .MESSAGING_DESTINATION : "topic-2" ,
206211 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
207212 },
@@ -210,8 +215,8 @@ def test_consume(self) -> None:
210215 {
211216 "name" : "topic-3 process" ,
212217 "attributes" : {
213- SpanAttributes . MESSAGING_OPERATION : "process" ,
214- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
218+ MESSAGING_OPERATION : "process" ,
219+ MESSAGING_SYSTEM : "kafka" ,
215220 SpanAttributes .MESSAGING_DESTINATION : "topic-3" ,
216221 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
217222 },
@@ -247,12 +252,12 @@ def test_close(self) -> None:
247252 {
248253 "name" : "topic-a process" ,
249254 "attributes" : {
250- SpanAttributes . MESSAGING_OPERATION : "process" ,
255+ MESSAGING_OPERATION : "process" ,
251256 SpanAttributes .MESSAGING_KAFKA_PARTITION : 0 ,
252- SpanAttributes . MESSAGING_SYSTEM : "kafka" ,
257+ MESSAGING_SYSTEM : "kafka" ,
253258 SpanAttributes .MESSAGING_DESTINATION : "topic-a" ,
254259 SpanAttributes .MESSAGING_DESTINATION_KIND : MessagingDestinationKindValues .QUEUE .value ,
255- SpanAttributes . MESSAGING_MESSAGE_ID : "topic-a.0.0" ,
260+ MESSAGING_MESSAGE_ID : "topic-a.0.0" ,
256261 },
257262 },
258263 ]
0 commit comments