otelgo.opentelemetry.io/otel/propagation Index | Files

package propagation

import "go.opentelemetry.io/otel/propagation"

Package propagation contains propagators for different format and carriers.

Index

Constants

const (
	B3SingleHeader       = "X-B3"
	B3DebugFlagHeader    = "X-B3-Flags"
	B3TraceIDHeader      = "X-B3-TraceId"
	B3SpanIDHeader       = "X-B3-SpanId"
	B3SampledHeader      = "X-B3-Sampled"
	B3ParentSpanIDHeader = "X-B3-ParentSpanId"
)
const (
	TraceparentHeader        = "Traceparent"
	CorrelationContextHeader = "Correlation-Context"
)

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 B3Propagator

type B3Propagator struct {
	SingleHeader bool
}

B3Propagator that facilitates core.SpanContext propagation using B3 Headers. This propagator supports both version of B3 headers,

  1. Single Header : X-B3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId}
  2. 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 (B3Propagator) Extract

Extract retrieves B3 Headers from the supplier

func (B3Propagator) GetAllKeys

func (b3 B3Propagator) GetAllKeys() []string

func (B3Propagator) Inject

func (b3 B3Propagator) Inject(ctx context.Context, supplier apipropagation.Supplier)

type TraceContextPropagator

type TraceContextPropagator struct{}

TraceContextPropagator propagates SpanContext in W3C TraceContext format.

func (TraceContextPropagator) Extract

func (TraceContextPropagator) GetAllKeys

func (hp TraceContextPropagator) GetAllKeys() []string

func (TraceContextPropagator) Inject

Source Files

b3_propagator.go binary_propagator.go doc.go trace_context_propagator.go

Version
v0.2.0
Published
Dec 3, 2019
Platform
darwin/amd64
Imports
11 packages
Last checked
32 minutes ago

Tools for package owners.