MediaWiki master
Wikimedia\Telemetry\ContextPropagatorInterface Interface Reference

Interface for classes to serialize and deserialize SpanContexts to and from implementation-specific arrays, called carriers. More...

Inherited by MediaWiki\Telemetry\MediaWikiPropagator, Wikimedia\Telemetry\CompositePropagator, Wikimedia\Telemetry\StaticInjectionPropagator, and Wikimedia\Telemetry\W3CTraceContextPropagator.

Public Member Functions

 extract (array $carrier)
 Attempt to extract a SpanContext from the given carrier.
 
 inject (?SpanContext $spanContext, array $carrier)
 Inject the given SpanContext into the given carrier.
 

Detailed Description

Interface for classes to serialize and deserialize SpanContexts to and from implementation-specific arrays, called carriers.

Usually the carrier will be HTTP request headers or similar.

See also
https://opentelemetry.io/docs/specs/otel/context/api-propagators/
Since
1.44

Definition at line 11 of file ContextPropagatorInterface.php.

Member Function Documentation

◆ extract()

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

◆ inject()

Wikimedia\Telemetry\ContextPropagatorInterface::inject ( ?SpanContext $spanContext,
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

Implemented in Wikimedia\Telemetry\CompositePropagator, Wikimedia\Telemetry\StaticInjectionPropagator, Wikimedia\Telemetry\W3CTraceContextPropagator, and MediaWiki\Telemetry\MediaWikiPropagator.


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