Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
null the context attrs after usage
  • Loading branch information
thugrock7 committed Sep 2, 2025
commit 9c1a3beac7a3298bb558f1b6a4d137cd888de7f1
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
span.setStatus(code >= 100 && code < 400 ? StatusCode.UNSET : StatusCode.ERROR);
}
if (msg instanceof LastHttpContent) {
// When we end the span, we should set the client context and client parent attr to null.
// so that for the next request a new context is made and stored in channel.
ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.CLIENT_CONTEXT)
.set(null);
ctx.channel()
.attr(
io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys
.CLIENT_PARENT_CONTEXT)
.set(null);
span.end();
}
}
Expand Down
Loading