Fix grizzly instrumentation
MODIFY
instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/auto/instrumentation/grizzly/GrizzlyHttpServerTracer.java
instrumentation/grizzly-2.0/src/main/java/io/opentelemetry/auto/instrumentation/grizzly/GrizzlyHttpServerTracer.java
@@ -61,16 +61,16 @@ public class GrizzlyHttpServerTracer
protected URI url(final HttpRequestPacket httpRequest) throws URISyntaxException {
return new URI(
(httpRequest.isSecure() ? "https://" : "http://")
- + httpRequest.getRemoteHost()
+ + httpRequest.serverName()
+ ":"
- + httpRequest.getLocalPort()
+ + httpRequest.getServerPort()
+ httpRequest.getRequestURI()
+ (httpRequest.getQueryString() != null ? "?" + httpRequest.getQueryString() : ""));
}
@Override
protected String peerHostIP(final HttpRequestPacket httpRequest) {
- return httpRequest.getLocalHost();
+ return httpRequest.getRemoteAddress();
}
@Override
@@ -95,6 +95,6 @@ public class GrizzlyHttpServerTracer
@Override
protected Integer peerPort(final HttpRequestPacket httpRequest) {
- return httpRequest.getLocalPort();
+ return httpRequest.getRemotePort();
}
}

Fix grizzly instrumentation (#887)