tracing

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option is tracing option.

func WithGlobalPropagator

func WithGlobalPropagator() Option

WithGlobalPropagator set the global TextMapPropagator

func WithGlobalTracerProvider

func WithGlobalTracerProvider() Option

WithGlobalTracerProvider set the registered global trace provider

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. 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, spanName string, opts ...Option) *Tracer

NewTracer create tracer instance

func (*Tracer) End

func (t *Tracer) End(_ context.Context, span trace.Span, err error, attrs ...attribute.KeyValue)

End finish tracing span

func (*Tracer) Inject

func (t *Tracer) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject set cross-cutting concerns from the Context into the carrier.

func (*Tracer) Start

Start starts tracing span

Jump to

Keyboard shortcuts

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