Documentation ¶
Index ¶
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 }
type Trace ¶
type Trace interface { // New span with certain fields preset. // Provide parent span if you have it. NewSpan(*Span) *Span // New context with span NewContext(context.Context, *Span) context.Context // Return a span from context FromContext(context.Context) (*Span, bool) // Span to Header NewHeader(map[string]string, *Span) map[string]string // Get span from header FromHeader(map[string]string) (*Span, bool) // Collect spans Collect(*Span) error // Start the collector Start() error // Stop the collector Stop() error // Name String() string }
Directories ¶
Path | Synopsis |
---|---|
Package go_micro_platform_trace is a generated protocol buffer package.
|
Package go_micro_platform_trace is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.