Documentation ¶
Overview ¶
Package propagation contains propagators for different format and carriers.
Index ¶
Constants ¶
View Source
const ( B3SingleHeader = "X-B3" B3DebugFlagHeader = "X-B3-Flags" B3TraceIDHeader = "X-B3-TraceId" B3SpanIDHeader = "X-B3-SpanId" B3SampledHeader = "X-B3-Sampled" B3ParentSpanIDHeader = "X-B3-ParentSpanId" )
View Source
const ( TraceparentHeader = "Traceparent" CorrelationContextHeader = "Correlation-Context" )
Variables ¶
This section is empty.
Functions ¶
func BinaryPropagator ¶
func BinaryPropagator() apipropagation.BinaryFormatPropagator
BinaryPropagator creates a new propagator. The propagator implements ToBytes and FromBytes method to transform SpanContext to/from byte array.
Types ¶
type HTTPB3Propagator ¶
type HTTPB3Propagator struct {
SingleHeader bool
}
HTTPB3Propagator that facilitates core.SpanContext propagation using B3 Headers. This propagator supports both version of B3 headers,
- Single Header : X-B3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId}
- Multiple Headers: X-B3-TraceId: {TraceId} X-B3-ParentSpanId: {ParentSpanId} X-B3-SpanId: {SpanId} X-B3-Sampled: {SamplingState} X-B3-Flags: {DebugFlag}
If SingleHeader is set to true then X-B3 header is used to inject and extract. Otherwise, separate headers are used to inject and extract.
func (HTTPB3Propagator) Extract ¶
func (b3 HTTPB3Propagator) Extract(ctx context.Context, supplier apipropagation.Supplier) (core.SpanContext, dctx.Map)
Extract retrieves B3 Headers from the supplier
func (HTTPB3Propagator) GetAllKeys ¶
func (b3 HTTPB3Propagator) GetAllKeys() []string
func (HTTPB3Propagator) Inject ¶
func (b3 HTTPB3Propagator) Inject(ctx context.Context, supplier apipropagation.Supplier)
type HTTPTraceContextPropagator ¶
type HTTPTraceContextPropagator struct{}
HTTPTraceContextPropagator propagates SpanContext in W3C TraceContext format.
func (HTTPTraceContextPropagator) Extract ¶
func (hp HTTPTraceContextPropagator) Extract( ctx context.Context, supplier apipropagation.Supplier, ) (core.SpanContext, dctx.Map)
func (HTTPTraceContextPropagator) GetAllKeys ¶
func (hp HTTPTraceContextPropagator) GetAllKeys() []string
func (HTTPTraceContextPropagator) Inject ¶
func (hp HTTPTraceContextPropagator) Inject(ctx context.Context, supplier apipropagation.Supplier)
Click to show internal directories.
Click to hide internal directories.