TraceContextPropagator
in package
implements
TextMapPropagatorInterface
TraceContext is a propagator that supports the W3C Trace Context format (https://www.w3.org/TR/trace-context/)
This propagator will propagate the traceparent and tracestate headers to guarantee traces are not broken. It is up to the users of this propagator to choose if they want to participate in a trace by modifying the traceparent header and relevant parts of the tracestate header containing their proprietary information.
Table of Contents
Interfaces
Constants
- FIELDS = [self::TRACEPARENT, self::TRACESTATE]
- TRACEPARENT = 'traceparent'
- TRACESTATE = 'tracestate'
- VERSION = '00'
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
Constants
FIELDS
public
mixed
FIELDS
= [self::TRACEPARENT, self::TRACESTATE]
TRACEPARENT
public
mixed
TRACEPARENT
= 'traceparent'
TRACESTATE
public
mixed
TRACESTATE
= 'tracestate'
VERSION
private
mixed
VERSION
= '00'
Properties
$instance
private
static self|null
$instance
= null
Methods
extract()
Extracts specific values from the provided carrier into the provided {@see ContextInterface} via an {@see PropagationGetterInterface}.
public
extract(mixed $carrier[, PropagationGetterInterface|null $getter = null ][, ContextInterface|null $context = null ]) : ContextInterface
Parameters
- $carrier : mixed
- $getter : PropagationGetterInterface|null = null
- $context : ContextInterface|null = null
Return values
ContextInterfacefields()
Returns list of fields that will be used by this propagator.
public
fields() : array<int, string>
Return values
array<int, string>getInstance()
public
static getInstance() : self
Return values
selfinject()
Injects specific values from the provided {@see ContextInterface} into the provided carrier via an {@see PropagationSetterInterface}.
public
inject(mixed &$carrier[, PropagationSetterInterface|null $setter = null ][, ContextInterface|null $context = null ]) : void
Parameters
- $carrier : mixed
- $setter : PropagationSetterInterface|null = null
- $context : ContextInterface|null = null
extractImpl()
private
static extractImpl(mixed $carrier, PropagationGetterInterface $getter) : SpanContextInterface
Parameters
- $carrier : mixed
- $getter : PropagationGetterInterface