Fix Operation name logging for Netty based applications (#2317)
This commit is contained in:
parent
1ca7276593
commit
1f884e4d97
|
@ -46,7 +46,9 @@ public class HttpServerRequestTracingHandler extends SimpleChannelUpstreamHandle
|
||||||
HttpRequest request = (HttpRequest) message;
|
HttpRequest request = (HttpRequest) message;
|
||||||
|
|
||||||
Context context =
|
Context context =
|
||||||
tracer().startSpan(request, ctx.getChannel(), channelTraceContext, "netty.request");
|
tracer()
|
||||||
|
.startSpan(
|
||||||
|
request, ctx.getChannel(), channelTraceContext, "HTTP " + request.getMethod());
|
||||||
try (Scope ignored = context.makeCurrent()) {
|
try (Scope ignored = context.makeCurrent()) {
|
||||||
ctx.sendUpstream(event);
|
ctx.sendUpstream(event);
|
||||||
// the span is ended normally in HttpServerResponseTracingHandler
|
// the span is ended normally in HttpServerResponseTracingHandler
|
||||||
|
|
|
@ -143,6 +143,6 @@ class Netty38ServerTest extends HttpServerTest<ServerBootstrap> implements Agent
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String expectedServerSpanName(ServerEndpoint endpoint) {
|
String expectedServerSpanName(ServerEndpoint endpoint) {
|
||||||
return "netty.request"
|
return "HTTP GET"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context context = tracer().startSpan((HttpRequest) msg, channel, channel, "netty.request");
|
HttpRequest request = (HttpRequest) msg;
|
||||||
|
Context context = tracer().startSpan(request, channel, channel, "HTTP " + request.getMethod());
|
||||||
try (Scope ignored = context.makeCurrent()) {
|
try (Scope ignored = context.makeCurrent()) {
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
// the span is ended normally in HttpServerResponseTracingHandler
|
// the span is ended normally in HttpServerResponseTracingHandler
|
||||||
|
|
|
@ -115,6 +115,6 @@ class Netty40ServerTest extends HttpServerTest<EventLoopGroup> implements AgentT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String expectedServerSpanName(ServerEndpoint endpoint) {
|
String expectedServerSpanName(ServerEndpoint endpoint) {
|
||||||
return "netty.request"
|
return "HTTP GET"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@ public class HttpServerRequestTracingHandler extends ChannelInboundHandlerAdapte
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context context = tracer().startSpan((HttpRequest) msg, channel, channel, "netty.request");
|
HttpRequest request = (HttpRequest) msg;
|
||||||
|
Context context = tracer().startSpan(request, channel, channel, "HTTP " + request.method());
|
||||||
try (Scope ignored = context.makeCurrent()) {
|
try (Scope ignored = context.makeCurrent()) {
|
||||||
ctx.fireChannelRead(msg);
|
ctx.fireChannelRead(msg);
|
||||||
// the span is ended normally in HttpServerResponseTracingHandler
|
// the span is ended normally in HttpServerResponseTracingHandler
|
||||||
|
|
|
@ -114,6 +114,6 @@ class Netty41ServerTest extends HttpServerTest<EventLoopGroup> implements AgentT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String expectedServerSpanName(ServerEndpoint endpoint) {
|
String expectedServerSpanName(ServerEndpoint endpoint) {
|
||||||
return "netty.request"
|
return "HTTP GET"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue