tracing

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecutionAttributes

func ExecutionAttributes(requestID string, req execute.Request) []attribute.KeyValue

func SpanAttributes

func SpanAttributes(attributes []attribute.KeyValue) []trace.SpanStartOption

func TraceContext

func TraceContext(ctx context.Context, t TraceInfo) context.Context

TraceContext injects the trace information into passed context.

func TraceContextFromMessage

func TraceContextFromMessage(ctx context.Context, payload []byte) (context.Context, error)

TraceContextFromMessage will try to extract TraceInfo from the JSON message.

func TraceContextWithPropagator

func TraceContextWithPropagator(ctx context.Context, propagator propagation.TextMapPropagator, t TraceInfo) context.Context

Types

type TraceInfo

type TraceInfo struct {
	Carrier propagation.MapCarrier
}

func GetTraceInfo

func GetTraceInfo(ctx context.Context) TraceInfo

GetTraceInfo extracts tracing information from the context.

func GetTraceInfoWithPropagator

func GetTraceInfoWithPropagator(ctx context.Context, propagator propagation.TextMapPropagator) TraceInfo

func (TraceInfo) Empty

func (t TraceInfo) Empty() bool

Empty returns true if the TraceInfo structure contains any tracing information.

type Tracer

type Tracer struct {
	trace.Tracer
}

func NewTracer

func NewTracer(name string, opts ...trace.TracerOption) *Tracer

func NewTracerFromProvider

func NewTracerFromProvider(tp trace.TracerProvider, name string, opts ...trace.TracerOption) *Tracer

func (*Tracer) WithSpanFromContext

func (t *Tracer) WithSpanFromContext(ctx context.Context, spanName string, f func() error, opts ...trace.SpanStartOption) error

Jump to

Keyboard shortcuts

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