diff --git a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/impl/KafkaSink.java b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/impl/KafkaSink.java index 11b257021e..34a1e467f7 100644 --- a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/impl/KafkaSink.java +++ b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/impl/KafkaSink.java @@ -298,7 +298,9 @@ private void createOutgoingTrace(Message message, String topic, int partition Scope scope = span.makeCurrent(); // Set Span attributes - span.setAttribute("partition", partition); + if (partition != -1) { + span.setAttribute(SemanticAttributes.MESSAGING_KAFKA_PARTITION, partition); + } span.setAttribute(SemanticAttributes.MESSAGING_SYSTEM, "kafka"); span.setAttribute(SemanticAttributes.MESSAGING_DESTINATION, topic); span.setAttribute(SemanticAttributes.MESSAGING_DESTINATION_KIND, "topic");