Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenTracingClientInterceptor ¶
func OpenTracingClientInterceptor(tracer opentracing.Tracer) grpc.UnaryClientInterceptor
OpenTracingClientInterceptor returns a grpc.UnaryClientInterceptor suitable for use in a grpc.Dial call.
For example:
conn, err := grpc.Dial( address, ..., // (existing DialOptions) grpc.WithUnaryInterceptor(otgrpc.OpenTracingClientInterceptor(tracer)))
All gRPC client spans will inject the OpenTracing SpanContext into the gRPC metadata; they will also look in the context.Context for an active in-process parent Span and establish a ChildOf reference if such a parent Span could be found.
func OpenTracingServerInterceptor ¶
func OpenTracingServerInterceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor
OpenTracingServerInterceptor returns a grpc.UnaryServerInterceptor suitable for use in a grpc.NewServer call.
For example:
s := grpc.NewServer( ..., // (existing ServerOptions) grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(tracer)))
All gRPC server spans will look for an OpenTracing SpanContext in the gRPC metadata; if found, the server span will act as the ChildOf that RPC SpanContext.
Root or not, the server Span will be embedded in the context.Context for the application-specific gRPC handler(s) to access.
func SetSpanTags ¶
SetSpanTags sets one or more tags on the given span according to the error.