Documentation ¶
Overview ¶
Package tracer provides an interface for distributed tracing
Package tracer provides an interface for distributed tracing
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DefaultSize of the buffer
DefaultSize = 64
)
Functions ¶
func FromContext ¶
FromContext returns a span from context
Types ¶
type Options ¶
type Options struct { Name string // Logger is the logger for messages Logger logger.Logger // Size is the size of ring buffer Size int }
Options struct
type Span ¶
type Span struct { // Id of the trace Trace string // name of the span Name string // id of the span Id string // parent span id Parent string // Start time Started time.Time // Duration in nano seconds Duration time.Duration // associated data Metadata metadata.Metadata // Type Type SpanType }
Span is used to record an entry
type Tracer ¶
type Tracer interface { Name() string Init(...Option) error // Start a trace Start(ctx context.Context, name string) (context.Context, *Span) // Finish the trace Finish(*Span) error // Lookup get span from context Lookup(ctx context.Context) (*Span, error) // Read the traces Read(...ReadOption) ([]*Span, error) }
Tracer is an interface for distributed tracing
Click to show internal directories.
Click to hide internal directories.