Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
kishansairam9 committed Jan 23, 2024
1 parent d25c176 commit b627b67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ public class HttpServerBlockingRequestHandler extends ChannelInboundHandlerAdapt
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
Channel channel = ctx.channel();
Deque<ServerContext> serverContexts = ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT).get();
Deque<ServerContext> serverContexts =
ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT)
.get();
ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null;
Context context = serverContext != null ? serverContext.context() : null;
if (context == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
Channel channel = ctx.channel();
Deque<ServerContext> serverContexts = ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT).get();
Deque<ServerContext> serverContexts =
ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT)
.get();
ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null;
Context context = serverContext != null ? serverContext.context() : null;
if (context == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ public class HttpServerResponseTracingHandler extends ChannelOutboundHandlerAdap

@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) {
Deque<ServerContext> serverContexts = ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT).get();
Deque<ServerContext> serverContexts =
ctx.channel()
.attr(io.opentelemetry.instrumentation.netty.v4_1.internal.AttributeKeys.SERVER_CONTEXT)
.get();
ServerContext serverContext = serverContexts != null ? serverContexts.peekFirst() : null;
Context context = serverContext != null ? serverContext.context() : null;

if (context == null) {
ctx.write(msg, prm);
return;
Expand Down

0 comments on commit b627b67

Please sign in to comment.