trace

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithSpan added in v1.1.0

func ContextWithSpan(ctx context.Context, span opentracing.Span) context.Context

ContextWithSpan return a new `context.Context` that holds a reference to the span

func FromIncomingContext

func FromIncomingContext(ctx context.Context) opentracing.StartSpanOption

FromIncomingContext extract trace info from span

func HeaderExtractor

func HeaderExtractor(carrier http.Header) opentracing.StartSpanOption

HeaderExtractor extract trace info from span

func HeaderInjector added in v1.3.0

func HeaderInjector(ctx context.Context, carrier http.Header) context.Context

HeaderInjector inject trace info to span

func MetadataInjector

func MetadataInjector(ctx context.Context, md metadata.MD) context.Context

MetadataInjector inject trace info to span

func SetGlobalTracer

func SetGlobalTracer(tracer opentracing.Tracer)

SetGlobalTracer set global trace instance

func SpanFromContext

func SpanFromContext(ctx context.Context) opentracing.Span

SpanFromContext return the span attached to current context

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, op string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context)

StartSpanFromContext start a span from current context

func TraceID

func TraceID(ctx context.Context) string

TraceID return trace id as string

Types

type CarrierMD added in v1.3.0

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

func (CarrierMD) ForeachKey added in v1.3.0

func (cm CarrierMD) ForeachKey(handler func(key, val string) error) error

ForeachKey returns TextMap contents via repeated calls to the `handler` function. If any call to `handler` returns a non-nil error, ForeachKey terminates and returns that error.

func (CarrierMD) Set added in v1.3.0

func (cm CarrierMD) Set(key, val string)

Set a key:value pair to the carrier. Multiple calls to Set() for the same key leads to undefined behavior.

type NullStartSpanOption

type NullStartSpanOption struct{}

func (NullStartSpanOption) Apply

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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