grpc-ecosystem / grpc-opentracing

OpenTracing is a set of consistent, expressive, vendor-neutral APIs for distributed tracing and context propagation
BSD 3-Clause "New" or "Revised" License
472 stars 98 forks source link

Am I supposed to be able to start spans from a grpc handler? #14

Closed F21 closed 7 years ago

F21 commented 7 years ago

I am using the go version of grpc-opentracing and have instrumented my grpc server. I can also see traces in the zipkin webui, but the traces only have 1 level.

I checked the context passed to my grpc handlers, and there were no active spans:

func (s *MyService) DoStuff(ctx context.Context, req *grpc.Request) (*graphql.Response, error) {
    sp := opentracing.SpanFromContext(ctx)
    fmt.Println(sp)
}

In the above, sp is always <nil> meaning that it was not able to get a span from the context. Am i supposed to be able to start child spans from within a grpc handler?

F21 commented 7 years ago

Just noticed there were issue with the instrumentation, resulting in the span not being found.