Skip to content

Commit 6ccc620

Browse files
committed
Track server context in netty4 instrumentation
1 parent d10055d commit 6ccc620

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
2828
Channel channel = ctx.channel();
2929
if (!(msg instanceof HttpRequest)) {
3030
final Context storedContext = channel.attr(CONTEXT_ATTRIBUTE_KEY).get();
31-
final AgentSpan span = spanFromContext(storedContext);
32-
if (span == null) {
31+
if (storedContext == null) {
3332
ctx.fireChannelRead(msg); // superclass does not throw
3433
} else {
35-
try (final ContextScope scope = span.attach()) {
34+
try (final ContextScope scope = storedContext.attach()) {
3635
ctx.fireChannelRead(msg); // superclass does not throw
3736
}
3837
}

0 commit comments

Comments
 (0)