tracing

package
v1.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

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

type ClientHandler struct{}

ClientHandler is tracing ClientHandler

func (*ClientHandler) HandleConn

func (c *ClientHandler) HandleConn(_ context.Context, _ stats.ConnStats)

HandleConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) HandleRPC

func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements per-RPC tracing and stats instrumentation.

func (*ClientHandler) TagConn

TagConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) TagRPC

TagRPC implements per-RPC context management.

type Metadata

type Metadata struct{}

Metadata is tracing metadata propagator

func (Metadata) Extract

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) Fields

func (b Metadata) Fields() []string

Fields returns the keys who's values are set with Inject.

func (Metadata) Inject

func (b Metadata) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject sets metadata key-values from ctx into the carrier.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option specifies instrumentation configuration options.

func WithDisabled

func WithDisabled(disabled bool) Option

WithDisabled set disabled trace.

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.

func WithTracerProvider

func WithTracerProvider(provider oteltrace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL