Documentation ¶
Index ¶
- func Client(opts ...Option) middleware.Middleware
- func Server(opts ...Option) middleware.Middleware
- func SpanID() log.Valuer
- func TraceID() log.Valuer
- type ClientHandler
- func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)
- func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
- func (c *ClientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (c *ClientHandler) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context
- type Metadata
- type Option
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(opts ...Option) middleware.Middleware
Client returns a new client middleware for OpenTelemetry.
func Server ¶
func Server(opts ...Option) middleware.Middleware
Server returns a new server middleware for OpenTelemetry.
Types ¶
type ClientHandler ¶ added in v2.0.5
type ClientHandler struct{}
ClientHandler is tracing ClientHandler
func (*ClientHandler) HandleConn ¶ added in v2.0.5
func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)
HandleConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) HandleRPC ¶ added in v2.0.5
func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
HandleRPC implements per-RPC tracing and stats instrumentation.
func (*ClientHandler) TagConn ¶ added in v2.0.5
func (c *ClientHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
TagConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) TagRPC ¶ added in v2.0.5
func (c *ClientHandler) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context
TagRPC implements per-RPC context management.
type Metadata ¶ added in v2.0.5
type Metadata struct{}
Metadata is tracing metadata propagator
func (Metadata) Extract ¶ added in v2.0.5
func (b Metadata) Extract(parent context.Context, carrier propagation.TextMapCarrier) context.Context
Extract returns a copy of parent with the metadata from the carrier added.
func (Metadata) Inject ¶ added in v2.0.5
func (b Metadata) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject sets metadata key-values from ctx into the carrier.
type Option ¶
type Option func(*options)
Option is tracing option.
func WithPropagator ¶
func WithPropagator(propagator propagation.TextMapPropagator) Option
WithPropagator with tracer propagator.
func WithTracerName ¶ added in v2.5.1
WithTracerName with tracer name
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider with tracer provider. By default, it uses the global provider that is set by otel.SetTracerProvider(provider).