tracing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "jaeger"

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

func SpanID() log.Valuer

SpanID returns a spanid valuer.

func TraceID

func TraceID() log.Valuer

TraceID returns a traceid valuer.

Types

type ClientHandler

type ClientHandler struct{}

ClientHandler is otel ClientHandler

func (*ClientHandler) HandleConn

func (c *ClientHandler) HandleConn(ctx context.Context, cs 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 otel and stats instrumentation.

func (*ClientHandler) TagConn

TagConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) TagRPC

TagRPC implements per-RPC context management.

type Option

type Option func(*options)

Option is otel option.

func WithPropagator

func WithPropagator(propagator propagation.TextMapPropagator) Option

WithPropagator with tracer propagator.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider with tracer provider. Deprecated: use otel.SetTracerProvider(provider) instead.

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(ctx context.Context, span trace.Span, m interface{}, err error)

End finish otel span

func (*Tracer) Start

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

Start start otel span

Jump to

Keyboard shortcuts

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