GRPC: Adds peer socket address when the client call is ready
Closes
MODIFY
instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingClientInterceptor.java
instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingClientInterceptor.java
@@ -59,8 +59,6 @@ final class TracingClientInterceptor implements ClientInterceptor {
}
}
- request.setPeerSocketAddress(result.getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR));
-
return new TracingClientCall<>(result, parentContext, context, request);
}
@@ -163,6 +161,7 @@ final class TracingClientInterceptor implements ClientInterceptor {
@Override
public void onReady() {
try (Scope ignored = context.makeCurrent()) {
+ request.setPeerSocketAddress(getAttributes().get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR));
delegate().onReady();
}
}

GRPC: Adds peer socket address when the client call is ready (#7451)

Closes
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7445