-
I am working with an application that is implemented using Java, a microservices architecture, and a gRPC communication layer. For observability, we have instrumented server and clients using OpenTelemetry. We started with automatic instrumentation but pivoted to manual instrumentation to gain finer control of the instrumentation. Currently, during transactions, the OpenTelemetry Context is not being propagated from the client to the server. The OpenTelemetry examples focus on RestAPI calls where the W3C Trace Context HTTP headers are injected into the HttpURLConnection transportLayer. In a Java/gRPC application, should the Context be propagated using TextMapPropagator where he carrier of propagated data on both the client (injector) and server (extractor) side is usually an http request? Or should the Context be propagated using gRPC interceptors which allow the application to interact with protobuf messages before or after they sent or received by the client or server? References: A HelloWorld like Java/gRPC/OpenTelemetry example where the Context is not correctly propagated between the gRPC server and client: https://github.com/jtayl222/grpc-java-instrumentation Example using HttpURLConnection transportLayer: https://opentelemetry.io/docs/instrumentation/java/manual/#context-propagation If we are going to use this approach for gRPC calls, what should be used for Carrier in Interface TextMapPropagator? Trace Context W3C Recommendation: https://www.w3.org/TR/trace-context Any help will be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hi @jtayl222! have you seen https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/grpc-1.6/library#library-instrumentation-for-grpc-160? using this is our recommendation for non-agent instrumentation |
Beta Was this translation helpful? Give feedback.
-
Updates are in https://github.com/jtayl222/grpc-java-instrumentation to include GrpcTelemetry. Should the example be added to the OpenTelemetry repo and/or should some details be included in https://opentelemetry.io/docs/instrumentation/java/manual/#context-propagation |
Beta Was this translation helpful? Give feedback.
hi @jtayl222! have you seen https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/grpc-1.6/library#library-instrumentation-for-grpc-160? using this is our recommendation for non-agent instrumentation