tracer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TraceIDKey .
	TraceIDKey = "traceid"
	// SpanIDKey .
	SpanIDKey = "spanid"

	// TraceInfoSep .
	TraceInfoSep = ":|:"
	// TraceOrSpanIDSep .
	TraceOrSpanIDSep = "_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span map[string]interface{}

Span represents a span.

func (Span) SpanID

func (sp Span) SpanID() string

SpanID returns span id.

func (Span) TraceID

func (sp Span) TraceID() string

TraceID returns trace id.

func (Span) Values

func (sp Span) Values() map[string]interface{}

Values returns span values.

type Tracer

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

Tracer represents a trace coding middleware.

func New

func New(tracePrefix string, spanPrefix string) *Tracer

New returns the trace coding middleware.

func (*Tracer) Decode

func (tracer *Tracer) Decode(client *arpc.Client, msg *arpc.Message) *arpc.Message

Decode implements arpc MessageCoder.

func (*Tracer) Encode

func (tracer *Tracer) Encode(client *arpc.Client, msg *arpc.Message) *arpc.Message

Encode implements arpc MessageCoder.

func (*Tracer) NewSpan

func (tracer *Tracer) NewSpan() Span

NewSpan creates a new span.

func (*Tracer) NextSpan

func (tracer *Tracer) NextSpan(values map[string]interface{}) Span

NextSpan inherit pre span's trace id and creates a new span.

Jump to

Keyboard shortcuts

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