tracing

package
v0.5.22 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Server ratelimiter middleware

func NewBuilder

func NewBuilder() middleware.MiddlewareBuilder

func Server

func Server(opts ...Option) middleware.Middleware

Server ratelimiter middleware

func SpanID

func SpanID(ctx sctx.Context) string

SpanID returns a spanid valuer.

func TraceID

func TraceID(ctx sctx.Context) string

TraceID returns a traceid valuer.

Types

type ClientHandler

type ClientHandler struct{}

ClientHandler is tracing 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 tracing and stats instrumentation.

func (*ClientHandler) TagConn

TagConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) TagRPC

TagRPC implements per-RPC context management.

type Config

type Config struct {
	SpanKind   trace.SpanKind `json:"span_kind" yaml:"span_kind"`
	Provider   string         `json:"provider" yaml:"provider"`
	Propagator string         `json:"propagator" yaml:"propagator"`
}

{"provider":"skywalking","propagator":"propagator"}

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 func(*options)

Option is tracing option.

func WithPropagator

func WithPropagator(propagator propagation.TextMapPropagator) Option

WithPropagator with tracer propagator.

func WithTracerName

func WithTracerName(tracerName string) Option

WithTracerName with tracer name.

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

func (*Tracer) End

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

End finish tracing span

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, path 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