MediaWiki master
Wikimedia\Telemetry\W3CTraceContextPropagator Class Reference

A ContextPropagatorInterface implementation for W3C Trace Context. More...

Inherits Wikimedia\Telemetry\ContextPropagatorInterface.

Collaboration diagram for 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.SpanContext may be null, in which case the propagator might still inject non-span-specific data.

Returns
array carrier with SpanContext injected

 

Detailed Description

A ContextPropagatorInterface implementation for W3C Trace Context.

This currently only supports a minimal subset of the spec: just the traceparent header, and only version 00.

It will refuse to inject a traceparent that would be invalid according to version 00 of the spec.

See also
https://www.w3.org/TR/trace-context/
Since
1.43
Access: internal

Definition at line 17 of file W3CTraceContextPropagator.php.

Member Function Documentation

◆ extract()

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

Attempt to extract a SpanContext from the given carrier.

Implements Wikimedia\Telemetry\ContextPropagatorInterface.

Definition at line 38 of file W3CTraceContextPropagator.php.

◆ inject()

Wikimedia\Telemetry\W3CTraceContextPropagator::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

Implements Wikimedia\Telemetry\ContextPropagatorInterface.

Definition at line 21 of file W3CTraceContextPropagator.php.


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