lidavidm commented on issue #37224:
URL: https://github.com/apache/arrow/issues/37224#issuecomment-1703217898

   - The OpenTelemetry plugin is still "internal": 
https://github.com/grpc/grpc/blob/master/src/cpp/ext/otel/otel_plugin.h
   - The implementation does not set up spans, only metrics: 
https://github.com/grpc/grpc/blob/master/src/cpp/ext/otel/otel_server_call_tracer.cc
   
   I don't think it's suitable quite yet.
   
   I started digging into the ['call tracer' 
interface](https://github.com/grpc/grpc/blob/master/src/core/lib/channel/call_tracer.h)
 it uses for implementation. The interface seems to provide everything we want, 
including callbacks for each message (though it is not clear when this is 
called: right before/during the RPC handler processing, or when the server 
first gets/writes the message?). And at first glance it looks like the 
interface is artificially limited: it has no way of communicating any data to 
the RPC handler, including an OpenTelemetry span. But how does the privileged 
OpenCensus plugin work? 
   
   
https://github.com/grpc/grpc/blob/0dd8a056b86074a5bc1341bfd5b8303b1d67e331/src/cpp/ext/filters/census/server_call_tracer.cc#L209-L212
   
   It turns out that you can stash a hardcoded set of data into the underlying 
grpc-core call context, including a _single_ "call tracer". This is a little 
unfortunate: that means only one call tracer can be used per application. But 
it means we should be able to implement what we want, it just means there is no 
composability. (Contrast this with gRPC-Java interceptors, which are far more 
powerful, though they have their own 
[pitfalls](https://github.com/grpc/grpc-java/issues/6092).)
   
   That means we could provide an OpenTelemetry tracer. It is a little 
unfortunate that we'd be essentially duplicating upstream work, though. It also 
wouldn't be able to work in combination with the upstream tracer, by design of 
gRPC.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to