opencensus-go icon indicating copy to clipboard operation
opencensus-go copied to clipboard

Span created on client stats handler is not accessible from client interceptor

Open jcchavezs opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. In the GRPC client, I am trying to access the span created by the stats handler from inside the interceptor but it is currently not possible as the context does not carry the span (see https://github.com/census-instrumentation/opencensus-go/pull/1233/files#diff-0dcdbbb99cd65803fcdadcb28ded881cR182), more so if the client span is a child of a parent span, we can access only the parent span but not the client span created by the stats handler (see https://github.com/census-instrumentation/opencensus-go/pull/1233/files#diff-0dcdbbb99cd65803fcdadcb28ded881cR120)

This happens because the interceptor calls the invoker and then it is the invoker the one that calls the StatsHandler which actually creates the span.

Describe the solution you'd like I'd like this to be consistent with GRPC server where you can access the span in the context from the interceptor (see https://github.com/census-instrumentation/opencensus-go/pull/1233/files#diff-0dcdbbb99cd65803fcdadcb28ded881cR194)

Describe alternatives you've considered None.

jcchavezs avatar Oct 08 '20 08:10 jcchavezs