Documentation ¶
Overview ¶
Package trace is an interface for tracing.
Index ¶
- Variables
- func ClientWrapper(t Trace, s *registry.Service) client.Wrapper
- func ContextWithSpan(ctx context.Context, s *Span) context.Context
- func HandlerWrapper(t Trace, s *registry.Service) server.HandlerWrapper
- func HeaderWithSpan(md map[string]string, s *Span) map[string]string
- func NewContext(ctx context.Context, c Trace) context.Context
- type Annotation
- type AnnotationType
- type Option
- type Options
- type Span
- type Trace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBatchSize = 100 DefaultBatchInterval = time.Second * 5 TraceTopic = "micro.trace.span" TraceHeader = "X-Micro-Trace-Id" SpanHeader = "X-Micro-Span-Id" ParentHeader = "X-Micro-Parent-Id" DebugHeader = "X-Micro-Trace-Debug" )
Functions ¶
func HandlerWrapper ¶
func HandlerWrapper(t Trace, s *registry.Service) server.HandlerWrapper
Types ¶
type Annotation ¶
type AnnotationType ¶
type AnnotationType int32
const ( AnnUnknown AnnotationType = 0 AnnStart AnnotationType = 1 AnnEnd AnnotationType = 2 AnnTimeout AnnotationType = 3 AnnClientRequest AnnotationType = 4 AnnClientResponse AnnotationType = 5 AnnClientPublication AnnotationType = 6 AnnServerRequest AnnotationType = 7 AnnServerResponse AnnotationType = 8 AnnServerSubscription AnnotationType = 9 )
type Option ¶
type Option func(o *Options)
func BatchInterval ¶
func CollectTimeout ¶
func Collectors ¶
type Span ¶
type Span struct { Name string // Topic / RPC Method Id string // id of this span TraceId string // The root trace id ParentId string // Parent span id Timestamp time.Time // Microseconds from epoch. When span started. Duration time.Duration // Microseconds. Duration of the span. Debug bool // Should persist no matter what. Source *registry.Service // Originating service Destination *registry.Service // Destination service sync.Mutex Annotations []*Annotation }
Click to show internal directories.
Click to hide internal directories.