go-grpc-middleware
go-grpc-middleware copied to clipboard
Question: Opentracing here vs github.com/grpc-ecosystem/grpc-opentracing
How does the opentracing part of this repo relate to https://github.com/grpc-ecosystem/grpc-opentracing/tree/master/go/otgrpc (otgrpc)?
It look like both package build middleware, using https://github.com/opentracing/opentracing-go
Are they alternative implementations? Are you in touch with the authors of otgrpc?
So, the otgrpc implements only a Unary handler, and this implements Streaming as well, both for client and server-side.
Both packages are indeed using opentracing-go since that is the official opentracing library for Go, and a lot of Tracer implementations are using it. As such, both pieces of middleware are agnostic as to what Tracer is used by the user: Zipkin, Jaeger, Stackdriver or whatever else.
The reason why this package is separate here is because it integrates with grpc_ctx and thus allows you to have traces tagged with, for example, fields extracted from the request.
@bhs, author of otgrpc for discussion context.
Would be nice to have a single place for such middleware, especially within the same organization.
@mwitkow just noticed this, sorry!
I believe that there's a PR to support Streaming with the otgrpc package... in any case, we (obviously) should not duplicate this effort in two places. Is there a reason that grpc_ctx support should/could not just be added to the otgrpc package?
@bhs well grpc_ctx is an internal package of the go-grpc-middlewares. That's the only reason.
Can you link me to the Streaming PR for otgrpc?
@mwitkow sure: https://github.com/grpc-ecosystem/grpc-opentracing/pull/25
@bhs @mwitkow Are there any plans to join forces and merge the 2 middlewares?
@F21
- Apologies for my delay, I missed this
@bhs:-/ - There are no plans that I'm aware of; that doesn't mean it's a bad idea, just that people have other priorities. I generally like the idea of minimizing the scope of packages, and for that reason have some natural bias towards the tracing-specific
grpc-opentracingrepo's charter; that said, everything is a tradeoff and if there's a compelling reason to merge the two middlewares I'm open to hearing about it.
Is there a method to get the span in grpc handler? the middleware creates a span, and I cannot log into it.
Seems not relevant, given tracing is no longer part of this repo (in v2), given OpenTelemetry maintains great interceptor.