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 ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext saves the tracer in the context
Types ¶
type EventOption ¶ added in v3.2.16
type EventOption func(o *EventOptions)
type EventOptions ¶ added in v3.2.16
type EventOptions struct{}
type Options ¶
type Options struct { // Logger used for logging Logger logger.Logger // Name of the tracer Name string }
Options struct
type Span ¶
type Span interface { // Tracer return underlining tracer Tracer() Tracer // Finish complete and send span Finish(opts ...SpanOption) // AddEvent add event to span AddEvent(name string, opts ...EventOption) // Context return context with span Context() context.Context // SetName set the span name SetName(name string) // SetLabels set the span labels SetLabels(labels ...Label) }
func SpanFromContext ¶ added in v3.2.16
SpanFromContext returns a span from context
type SpanOption ¶ added in v3.2.16
type SpanOption func(o *SpanOptions)
type SpanOptions ¶ added in v3.2.16
type SpanOptions struct{}
type Tracer ¶
type Tracer interface { // Name return tracer name Name() string // Init tracer with options Init(...Option) error // Start a trace Start(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) }
Tracer is an interface for distributed tracing
func FromContext ¶
FromContext returns a tracer from context
Click to show internal directories.
Click to hide internal directories.