tracing

package
v2.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 21 Imported by: 413

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.

func SpanID added in v2.1.0

func SpanID() log.Valuer

SpanID returns a spanid valuer.

func TraceID added in v2.1.0

func TraceID() log.Valuer

TraceID returns a traceid valuer.

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

TagConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) TagRPC added in v2.0.5

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) Fields added in v2.0.5

func (b Metadata) Fields() []string

Fields returns the keys whose values are set with Inject.

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

func WithTracerName(tracerName string) Option

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

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer is otel span tracer

func NewTracer

func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer

NewTracer create tracer instance

func (*Tracer) End

func (t *Tracer) End(_ context.Context, span trace.Span, m interface{}, err error)

End finish tracing span

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, operation string, carrier propagation.TextMapCarrier) (context.Context, trace.Span)

Start start tracing span

Jump to

Keyboard shortcuts

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