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 HTTPB3Propagator

type HTTPB3Propagator struct {
	SingleHeader bool
}

HTTPB3Propagator 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 (HTTPB3Propagator) Extract

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 (HTTPTraceContextPropagator) GetAllKeys

func (hp HTTPTraceContextPropagator) GetAllKeys() []string

func (HTTPTraceContextPropagator) Inject

Source Files

binary_propagator.go doc.go http_b3_propagator.go http_trace_context_propagator.go

Version
v0.1.1
Published
Nov 15, 2019
Platform
darwin/amd64
Imports
11 packages
Last checked
39 minutes ago

Tools for package owners.