diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java index 9d6f5bd8c292..e61269027800 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSpan.java @@ -8,6 +8,7 @@ import io.grpc.Context; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Tracer; +import io.opentelemetry.trace.attributes.SemanticAttributes; public class MessagingConsumerSpan extends DelegatingSpan implements MessagingConsumerSemanticConvention { @@ -273,7 +274,7 @@ public MessagingConsumerSemanticConvention setNetTransport(String netTransport) */ @Override public MessagingConsumerSemanticConvention setMessagingOperation(String messagingOperation) { - delegate.setAttribute("messaging.operation", messagingOperation); + delegate.setAttribute(SemanticAttributes.MESSAGING_OPERATION, messagingOperation); return this; } @@ -515,7 +516,7 @@ public MessagingConsumerSpanBuilder setNetTransport(String netTransport) { * this span describes. */ public MessagingConsumerSpanBuilder setMessagingOperation(String messagingOperation) { - internalBuilder.setAttribute("messaging.operation", messagingOperation); + internalBuilder.setAttribute(SemanticAttributes.MESSAGING_OPERATION, messagingOperation); return this; } } diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java index f880b3114d5f..ef41e130d170 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/typedspan/MessagingConsumerSynchronousSpan.java @@ -8,6 +8,7 @@ import io.grpc.Context; import io.opentelemetry.trace.Span; import io.opentelemetry.trace.Tracer; +import io.opentelemetry.trace.attributes.SemanticAttributes; public class MessagingConsumerSynchronousSpan extends DelegatingSpan implements MessagingConsumerSynchronousSemanticConvention { @@ -280,7 +281,7 @@ public MessagingConsumerSynchronousSemanticConvention setNetTransport(String net @Override public MessagingConsumerSynchronousSemanticConvention setMessagingOperation( String messagingOperation) { - delegate.setAttribute("messaging.operation", messagingOperation); + delegate.setAttribute(SemanticAttributes.MESSAGING_OPERATION, messagingOperation); return this; } @@ -526,7 +527,7 @@ public MessagingConsumerSynchronousSpanBuilder setNetTransport(String netTranspo */ public MessagingConsumerSynchronousSpanBuilder setMessagingOperation( String messagingOperation) { - internalBuilder.setAttribute("messaging.operation", messagingOperation); + internalBuilder.setAttribute(SemanticAttributes.MESSAGING_OPERATION, messagingOperation); return this; } }