grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Telemetry support

Open wingyplus opened this issue 3 years ago • 5 comments

It would be good if have telemetry support for this library. I'm not sure if interceptor is a good fit but we can start from that.

wingyplus avatar Jul 19 '22 04:07 wingyplus

I think some default interceptors would do just fine, although perhaps we can have events being published directly by the core server and client functions.

I would have something like [:grpc, :server, ...] and [:grpc, :client, ...] for the event names. What do you propose we publish through telemetry? I think we should decide what events we want and then we can look at how to implement them

polvalente avatar Jul 19 '22 15:07 polvalente

I want to start something simple like execution time such as [:grpc, :server, :start], [:grpc, :server, :stop], [:grpc, :client, :start] and [:grpc, :client, :stop]. (Event prefix can be change). This could use :telemetry.span to wrap this process.

I would prototype this feature to see how it going and discuss a bit more in details. :)

wingyplus avatar Jul 20 '22 02:07 wingyplus

Those make sense, although I would use [:grpc, :server, :request] as the name of the event (to which telemetry span would append start and stop and exception).

I think we should include the stream as part of the metadata. I think it's basically a mixture of what Tesla and Phoenix do with Telemetry.

Since client-server connections aren't necessarily related to each request, we should perhaps add separate events for connect and disconnect on both sides as well

polvalente avatar Jul 20 '22 02:07 polvalente

@wingyplus to be clear, I think we're ready for a PR on these events :) Ideally we don't do it using the adapters so that we can ensure the events are published regardless of the adapter used

polvalente avatar Jul 20 '22 14:07 polvalente

Yeah. I’ll looking into it after setup ci is done. :)

wingyplus avatar Jul 20 '22 16:07 wingyplus

As a point of reference, I'll work to publish events so we can export all metrics that grpc_prometheus currently exports

polvalente avatar Jan 29 '23 01:01 polvalente