Fix netty 4.1 tests
MODIFY
instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/NettyChannelPipelineInstrumentation.java
instrumentation/netty/netty-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4_1/NettyChannelPipelineInstrumentation.java
@@ -90,13 +90,18 @@ public class NettyChannelPipelineInstrumentation implements TypeInstrumentation
public static void addHandler(
@Advice.Enter int callDepth,
@Advice.This ChannelPipeline pipeline,
- @Advice.Argument(1) String name,
+ @Advice.Argument(1) String handlerName,
@Advice.Argument(2) ChannelHandler handler) {
if (callDepth > 0) {
return;
}
CallDepthThreadLocalMap.reset(handler.getClass());
+ String name = handlerName;
+ if (name == null) {
+ name = pipeline.context(handler).name();
+ }
+
try {
// Server pipeline handlers
if (handler instanceof HttpServerCodec) {

Fix netty 4.1 tests (#2122)