Better span names for netty
MODIFY
instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/auto/instrumentation/netty40/ChannelFutureListenerInstrumentation.java
instrumentation/netty/netty-4.0/src/main/java/io/opentelemetry/auto/instrumentation/netty40/ChannelFutureListenerInstrumentation.java
@@ -17,6 +17,7 @@ package io.opentelemetry.auto.instrumentation.netty40;
import static io.opentelemetry.auto.tooling.ClassLoaderMatcher.hasClassesNamed;
import static io.opentelemetry.auto.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface;
+import static io.opentelemetry.trace.Span.Kind.CLIENT;
import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -104,7 +105,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
final Scope parentScope = NettyHttpServerDecorator.TRACER.withSpan(parentSpan);
final Span errorSpan =
- NettyHttpServerDecorator.TRACER.spanBuilder("netty.connect").startSpan();
+ NettyHttpServerDecorator.TRACER.spanBuilder("CONNECT").setSpanKind(CLIENT).startSpan();
errorSpan.setAttribute(Tags.COMPONENT, "netty");
try (final Scope scope = NettyHttpServerDecorator.TRACER.withSpan(errorSpan)) {
NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause);

MODIFY
instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy
instrumentation/netty/netty-4.0/src/test/groovy/Netty40ClientTest.groovy
@@ -92,7 +92,7 @@ class Netty40ClientTest extends HttpClientTest {
// for up to a total of 10 seconds (default connection time limit)
for (def i = 1; i < size; i++) {
span(i) {
- operationName "netty.connect"
+ operationName "CONNECT"
childOf span(0)
errored true
tags {

MODIFY
instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/auto/instrumentation/netty41/ChannelFutureListenerInstrumentation.java
instrumentation/netty/netty-4.1/src/main/java/io/opentelemetry/auto/instrumentation/netty41/ChannelFutureListenerInstrumentation.java
@@ -17,6 +17,7 @@ package io.opentelemetry.auto.instrumentation.netty41;
import static io.opentelemetry.auto.tooling.ClassLoaderMatcher.hasClassesNamed;
import static io.opentelemetry.auto.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface;
+import static io.opentelemetry.trace.Span.Kind.CLIENT;
import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -104,7 +105,7 @@ public class ChannelFutureListenerInstrumentation extends Instrumenter.Default {
final Scope parentScope = NettyHttpServerDecorator.TRACER.withSpan(parentSpan);
final Span errorSpan =
- NettyHttpServerDecorator.TRACER.spanBuilder("netty.connect").startSpan();
+ NettyHttpServerDecorator.TRACER.spanBuilder("CONNECT").setSpanKind(CLIENT).startSpan();
errorSpan.setAttribute(Tags.COMPONENT, "netty");
try (final Scope scope = NettyHttpServerDecorator.TRACER.withSpan(errorSpan)) {
NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause);

MODIFY
instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy
instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy
@@ -102,7 +102,7 @@ class Netty41ClientTest extends HttpClientTest {
// for up to a total of 10 seconds (default connection time limit)
for (def i = 1; i < size; i++) {
span(i) {
- operationName "netty.connect"
+ operationName "CONNECT"
childOf span(0)
errored true
tags {

Better span names for netty (#247)