OpenTelemetry PHP

B3MultiPropagator
in package
implements TextMapPropagatorInterface

FinalYes

B3Multi is a propagator that supports the specification for multiple "b3" http headers used for trace context propagation across service boundaries.

(https://github.com/openzipkin/b3-propagation#multiple-headers)

Table of Contents

Interfaces

TextMapPropagatorInterface

Constants

DEBUG_FLAG  = 'X-B3-Flags'
Debug is encoded as X-B3-Flags: 1.
FIELDS  = [self::TRACE_ID, self::SPAN_ID, self::PARENT_SPAN_ID, self::SAMPLED, self::DEBUG_FLAG]
IS_NOT_SAMPLED  = '0'
IS_SAMPLED  = '1'
PARENT_SPAN_ID  = 'X-B3-ParentSpanId'
The X-B3-ParentSpanId header must be present on a child span and absent on the root span.
SAMPLED  = 'X-B3-Sampled'
An accept sampling decision is encoded as X-B3-Sampled: 1 and a deny as X-B3-Sampled: 0.
SPAN_ID  = 'X-B3-SpanId'
The X-B3-SpanId header is required and is encoded as 16 lower-hex characters.
TRACE_ID  = 'X-B3-TraceId'
The X-B3-TraceId header is required and is encoded as 32 or 16 lower-hex characters.
VALID_NON_SAMPLED  = [self::IS_NOT_SAMPLED, 'false']
VALID_SAMPLED  = [self::IS_SAMPLED, 'true']

Properties

$instance  : self|null

Methods

extract()  : ContextInterface
Extracts specific values from the provided carrier into the provided {@see ContextInterface} via an {@see PropagationGetterInterface}.
fields()  : array<int, string>
Returns list of fields that will be used by this propagator.
getInstance()  : self
inject()  : void
Injects specific values from the provided {@see ContextInterface} into the provided carrier via an {@see PropagationSetterInterface}.
extractImpl()  : SpanContextInterface
getSampledValue()  : int|null

Constants

FIELDS

private mixed FIELDS = [self::TRACE_ID, self::SPAN_ID, self::PARENT_SPAN_ID, self::SAMPLED, self::DEBUG_FLAG]

SAMPLED

An accept sampling decision is encoded as X-B3-Sampled: 1 and a deny as X-B3-Sampled: 0.

private mixed SAMPLED = 'X-B3-Sampled'

Absent means defer the decision to the receiver of this header. For example, a Sampled header might look like: X-B3-Sampled: 1

Note: Before this specification was written, some tracers propagated X-B3-Sampled as true or false as opposed to 1 or 0. While you shouldn't encode X-B3-Sampled as true or false, a lenient implementation may accept them.

Tags
see
https://github.com/openzipkin/b3-propagation#sampling-state-1

SPAN_ID

The X-B3-SpanId header is required and is encoded as 16 lower-hex characters.

private mixed SPAN_ID = 'X-B3-SpanId'

For example, a SpanId header might look like: X-B3-SpanId: a2fb4a1d1a96d312 . Unless propagating only the Sampling State, the X-B3-SpanId header is required.

Tags
see
https://github.com/openzipkin/b3-propagation#spanid-1

TRACE_ID

The X-B3-TraceId header is required and is encoded as 32 or 16 lower-hex characters.

private mixed TRACE_ID = 'X-B3-TraceId'

For example, a 128-bit TraceId header might look like: X-B3-TraceId: 463ac35c9f6413ad48485a3953bb6124 . Unless propagating only the Sampling State, the X-B3-TraceId header is required.

Tags
see
https://github.com/openzipkin/b3-propagation#traceid-1

VALID_NON_SAMPLED

private mixed VALID_NON_SAMPLED = [self::IS_NOT_SAMPLED, 'false']

Properties

Methods

fields()

Returns list of fields that will be used by this propagator.

public fields() : array<int, string>
Return values
array<int, string>

        
On this page

Search results