Documentation ¶
Overview ¶
Package propagation manages propagation of trace context headers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor inserts trace context into and extracts trace context out of different types.
func (Extractor) Extract ¶
func (e Extractor) Extract(events ...interface{}) (*TraceContext, error)
Extract looks in the given events one by one and returns once a proper trace context is found.
func (Extractor) ExtractFromLayer ¶
func (e Extractor) ExtractFromLayer(hdr http.Header) *TraceContextExtended
ExtractFromLayer is used for extracting context from the request headers sent from a tracing layer. Currently, only datadog style headers are extracted. If a trace id or parent id are not found, then the embedded *TraceContext will be nil.
func (Extractor) InjectToLayer ¶
func (e Extractor) InjectToLayer(tc *TraceContext, hdr http.Header)
InjectToLayer is used for injecting context into the response headers sent to a tracing layer. Currently, only datadog style headers are injected.
type TraceContext ¶
type TraceContext struct { TraceID uint64 TraceIDUpper64Hex string ParentID uint64 SamplingPriority sampler.SamplingPriority }
TraceContext stores the propagated trace context values.
type TraceContextExtended ¶
type TraceContextExtended struct { *TraceContext SpanID uint64 InvocationError bool }
TraceContextExtended stores the propagated trace context values plus other non-standard header values.