MediaWiki master
Wikimedia\Telemetry\CompositePropagator Class Reference

CompositePropagator accepts an array of other propagators. More...

Inherits Wikimedia\Telemetry\ContextPropagatorInterface.

Collaboration diagram for Wikimedia\Telemetry\CompositePropagator:

Public Member Functions

 __construct (array $propagators)
 
 extract (array $carrier)
 Attempt to extract a SpanContext from the given carrier.
 
 inject (?SpanContext $context, array $carrier)
 Inject the given SpanContext into the given carrier.SpanContext may be null, in which case the propagator might still inject non-span-specific data.

Returns
array carrier with SpanContext injected

 

Detailed Description

CompositePropagator accepts an array of other propagators.

It delegates to each of them in order when extracting or injecting. When extracting, it returns the first non-null result.

Definition at line 12 of file CompositePropagator.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Telemetry\CompositePropagator::__construct ( array $propagators)
Parameters
ContextPropagatorInterface[]$propagators
Exceptions
ParameterAssertionExceptionif $propagators is empty

Definition at line 20 of file CompositePropagator.php.

Member Function Documentation

◆ extract()

Wikimedia\Telemetry\CompositePropagator::extract ( array $carrier)

Attempt to extract a SpanContext from the given carrier.

Implements Wikimedia\Telemetry\ContextPropagatorInterface.

Definition at line 32 of file CompositePropagator.php.

◆ inject()

Wikimedia\Telemetry\CompositePropagator::inject ( ?SpanContext $context,
array $carrier )

Inject the given SpanContext into the given carrier.SpanContext may be null, in which case the propagator might still inject non-span-specific data.

Returns
array carrier with SpanContext injected

Implements Wikimedia\Telemetry\ContextPropagatorInterface.

Definition at line 45 of file CompositePropagator.php.


The documentation for this class was generated from the following file: