const ( TagTraceId = "trace.traceid" TagSpanId = "trace.spanid" TagSampled = "trace.sampled" )
func ClientAddContextTags(ctx context.Context, tags opentracing.Tags) context.Context
ClientAddContextTags returns a context with specified opentracing tags, which are used by UnaryClientInterceptor/StreamClientInterceptor when creating a new span.
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor
StreamClientInterceptor returns a new streaming client interceptor for OpenTracing.
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor for OpenTracing.
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor
UnaryClientInterceptor returns a new unary client interceptor for OpenTracing.
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor for OpenTracing.
FilterFunc allows users to provide a function that filters out certain methods from being traced.
If it returns false, the given request will not be traced.
type FilterFunc func(ctx context.Context, fullMethodName string) bool
OpNameFunc is a func that allows custom operation names instead of the gRPC method.
type OpNameFunc func(method string) string
type Option func(*options)
func WithFilterFunc(f FilterFunc) Option
WithFilterFunc customizes the function used for deciding whether a given call is traced or not.
func WithOpName(f OpNameFunc) Option
WithOpName customizes the trace Operation name
func WithTraceHeaderName(name string) Option
WithTraceHeaderName customizes the trace header name where trace metadata passed with requests. Default one is `uber-trace-id`
func WithTracer(tracer opentracing.Tracer) Option
WithTracer sets a custom tracer to be used for this middleware, otherwise the opentracing.GlobalTracer is used.
func WithUnaryRequestHandlerFunc(f UnaryRequestHandlerFunc) Option
WithUnaryRequestHandlerFunc sets a custom handler for the request
UnaryRequestHandlerFunc is a custom request handler
type UnaryRequestHandlerFunc func(span opentracing.Span, req interface{})