census-instrumentation / opencensus-ruby

A stats collection and distributed tracing framework
Apache License 2.0
91 stars 23 forks source link

Integrate with gRPC #79

Open jparsana opened 6 years ago

jparsana commented 6 years ago

Implement gRPC plugin that would enable tracing for gRPC request on client and server side. It should also instrument for collecting basic stats for gRPC requests/responses. Provide an easy way to enable those stats collections. See reference implementation in Java for both tracing and stats.

0x2c7 commented 6 years ago

One note for this issue. The gRPC's Ruby implementation support a middleware mechanism called interceptors: https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/generic/interceptors.rb. With this mechanism, we can add the tracing and stats without the need of monkey patching.

south37 commented 4 years ago

I created a gem to integrate opencensus-ruby with gRPC. cf. https://rubygems.org/gems/grpc_opencensus_interceptor

Fow now, only the server interceptor's #request_response method is supported. The functionality is limited, but it works well for my use.

I also created a PR based on this gem. Please take a look if you are interested in it. https://github.com/census-instrumentation/opencensus-ruby/pull/123