trace

package
v0.0.0-...-acd4c60 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const KeyName = "traceId"

Variables

This section is empty.

Functions

func New

func New(conf config.Configuration) (tracer opentracing.Tracer, closer io.Closer)

func NewCtxWithTraceId

func NewCtxWithTraceId(ctx context.Context) context.Context

func NewTraceId

func NewTraceId() string

func Set

func Set(conf config.Configuration) func()

func TraceIdFromContext

func TraceIdFromContext(ctx context.Context) (traceId string)

TraceIdFromContext 从context中获取TraceId

func TraceIdSpanFromContext

func TraceIdSpanFromContext(ctx context.Context) (traceId string)

TraceIdSpanFromContext

Types

type NullCloser

type NullCloser struct {
}

func (*NullCloser) Close

func (*NullCloser) Close() error

type TraceId

type TraceId struct {
	High, Low uint64
}

TraceId represents unique 128bit identifier of a trace

func (TraceId) IsValid

func (t TraceId) IsValid() bool

IsValid checks if the TraceId is valid, i.e. not zero.

func (TraceId) String

func (t TraceId) String() string

Jump to

Keyboard shortcuts

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