open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.9k stars 827 forks source link

Using grpc-opentelemetry for instrumenting GRPC #11537

Open anuragagarwal561994 opened 3 months ago

anuragagarwal561994 commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently custom library is being used for tracking grpc requests, grpc-java in their latest release have added support for OpenTelemetry metrics. It would be simple and provide more information and if we use the new grpc-opentelemetry library instead.

Describe the solution you'd like

We should use the grpc-opentelemetry setup provided by grpc-java

https://github.com/grpc/grpc-java/tree/master/opentelemetry

Describe alternatives you've considered

No response

Additional context

No response

anuragagarwal561994 commented 3 months ago

Let me know what the community thinks of the same or if more information is required and I can help contributing

laurit commented 3 months ago

As you mentioned the opentelemetry plugin in grpc-java provides only metrics. The grpc instrumentation here also provides traces so replacing it with what grpc-java has is not an option at the moment. Furthermore the code in grpc-java does not follow open telemetry semantic conventions. What could be considered is an instrumentation that automatically enables the metrics when opentelemetry plugin for grpc-java is present (I assume that by default user needs to manually enable it).

anuragagarwal561994 commented 3 months ago

@laurit yes that is what I was intending to

trask commented 3 months ago

we are planning to collaborate with the gRPC team when we kick off the RPC semantic convention stability effort later this year, it may be worth waiting to see what comes out of that effort