Documentation ¶
Index ¶
- func Extract(ctx context.Context, metadata *metadata.MD) ([]core.KeyValue, core.SpanContext)
- func Inject(ctx context.Context, metadata *metadata.MD)
- func StreamClientInterceptor(tracer trace.Tracer) grpc.StreamClientInterceptor
- func StreamServerInterceptor(tracer trace.Tracer) grpc.StreamServerInterceptor
- func UnaryClientInterceptor(tracer trace.Tracer) grpc.UnaryClientInterceptor
- func UnaryServerInterceptor(tracer trace.Tracer) grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
Extract returns the correlation context and span context that another service encoded in the gRPC metadata object with Inject. This function is meant to be used on incoming requests.
func Inject ¶
Inject injects correlation context and span context into the gRPC metadata object. This function is meant to be used on outgoing requests.
func StreamClientInterceptor ¶ added in v0.4.3
func StreamClientInterceptor(tracer trace.Tracer) grpc.StreamClientInterceptor
StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable for use in a grpc.Dial call.
For example:
tracer := global.Tracer("client-tracer") s := grpc.Dial( grpc.WithStreamInterceptor(grpctrace.StreamClientInterceptor(tracer)), ..., // (existing DialOptions))
func StreamServerInterceptor ¶ added in v0.4.3
func StreamServerInterceptor(tracer trace.Tracer) grpc.StreamServerInterceptor
StreamServerInterceptor returns a grpc.StreamServerInterceptor suitable for use in a grpc.NewServer call.
For example:
tracer := global.Tracer("client-tracer") s := grpc.Dial( grpc.StreamInterceptor(grpctrace.StreamServerInterceptor(tracer)), ..., // (existing ServerOptions))
func UnaryClientInterceptor ¶ added in v0.4.3
func UnaryClientInterceptor(tracer trace.Tracer) grpc.UnaryClientInterceptor
UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable for use in a grpc.Dial call.
For example:
tracer := global.Tracer("client-tracer") s := grpc.NewServer( grpc.WithUnaryInterceptor(grpctrace.UnaryClientInterceptor(tracer)), ..., // (existing DialOptions))
func UnaryServerInterceptor ¶ added in v0.4.3
func UnaryServerInterceptor(tracer trace.Tracer) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a grpc.UnaryServerInterceptor suitable for use in a grpc.NewServer call.
For example:
tracer := global.Tracer("client-tracer") s := grpc.Dial( grpc.UnaryInterceptor(grpctrace.UnaryServerInterceptor(tracer)), ..., // (existing ServerOptions))
Types ¶
This section is empty.