|
1 | 1 | package io.smallrye.reactive.messaging.kafka.tracing; |
2 | 2 |
|
3 | | -import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION; |
4 | 3 | import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_KIND; |
| 4 | +import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_DESTINATION_NAME; |
5 | 5 | import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_SYSTEM; |
6 | 6 | import static io.smallrye.reactive.messaging.kafka.companion.RecordQualifiers.until; |
7 | 7 | import static java.util.stream.Collectors.toList; |
@@ -113,7 +113,7 @@ public void testFromAppToKafka() { |
113 | 113 | assertEquals(SpanKind.PRODUCER, span.getKind()); |
114 | 114 | assertEquals("kafka", span.getAttributes().get(MESSAGING_SYSTEM)); |
115 | 115 | assertEquals("topic", span.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
116 | | - assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION)); |
| 116 | + assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
117 | 117 | assertEquals(topic + " send", span.getName()); |
118 | 118 | }); |
119 | 119 | } |
@@ -147,7 +147,7 @@ public void testFromAppToKafkaWithStructuredCloudEvents() { |
147 | 147 | assertEquals(SpanKind.PRODUCER, span.getKind()); |
148 | 148 | assertEquals("kafka", span.getAttributes().get(MESSAGING_SYSTEM)); |
149 | 149 | assertEquals("topic", span.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
150 | | - assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION)); |
| 150 | + assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
151 | 151 | assertEquals(topic + " send", span.getName()); |
152 | 152 | }); |
153 | 153 | } |
@@ -181,7 +181,7 @@ public void testFromAppToKafkaWithBinaryCloudEvents() { |
181 | 181 | assertEquals(SpanKind.PRODUCER, span.getKind()); |
182 | 182 | assertEquals("kafka", span.getAttributes().get(MESSAGING_SYSTEM)); |
183 | 183 | assertEquals("topic", span.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
184 | | - assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION)); |
| 184 | + assertEquals(topic, span.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
185 | 185 | assertEquals(topic + " send", span.getName()); |
186 | 186 | }); |
187 | 187 | } |
@@ -223,15 +223,15 @@ public void testFromKafkaToAppToKafka() { |
223 | 223 | SpanData consumer = parentSpans.get(0); |
224 | 224 | assertEquals(SpanKind.CONSUMER, consumer.getKind()); |
225 | 225 | assertEquals("topic", consumer.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
226 | | - assertEquals(parentTopic, consumer.getAttributes().get(MESSAGING_DESTINATION)); |
| 226 | + assertEquals(parentTopic, consumer.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
227 | 227 | assertEquals(parentTopic + " receive", consumer.getName()); |
228 | 228 |
|
229 | 229 | SpanData producer = spans.stream().filter(spanData -> spanData.getParentSpanId().equals(consumer.getSpanId())) |
230 | 230 | .findFirst().get(); |
231 | 231 | assertEquals(SpanKind.PRODUCER, producer.getKind()); |
232 | 232 | assertEquals("kafka", producer.getAttributes().get(MESSAGING_SYSTEM)); |
233 | 233 | assertEquals("topic", producer.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
234 | | - assertEquals(resultTopic, producer.getAttributes().get(MESSAGING_DESTINATION)); |
| 234 | + assertEquals(resultTopic, producer.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
235 | 235 | assertEquals(resultTopic + " send", producer.getName()); |
236 | 236 | }); |
237 | 237 | } |
@@ -282,7 +282,7 @@ public void testFromKafkaToAppWithParentSpan() { |
282 | 282 | .findFirst().get(); |
283 | 283 | assertEquals("kafka", consumer.getAttributes().get(MESSAGING_SYSTEM)); |
284 | 284 | assertEquals("topic", consumer.getAttributes().get(MESSAGING_DESTINATION_KIND)); |
285 | | - assertEquals(parentTopic, consumer.getAttributes().get(MESSAGING_DESTINATION)); |
| 285 | + assertEquals(parentTopic, consumer.getAttributes().get(MESSAGING_DESTINATION_NAME)); |
286 | 286 | assertEquals(parentTopic + " receive", consumer.getName()); |
287 | 287 | }); |
288 | 288 | } |
|
0 commit comments