class HttpHeaderPropagator implements PropagatorInterface

This propagator uses HTTP headers to propagate SpanContext over HTTP.

The default headers is X-Cloud-Trace-Context.

Constants

DEFAULT_HEADER

Methods

__construct(FormatterInterface $formatter = null, $header = null)

Create a new HttpHeaderPropagator

extract(array $headers)

Generate a SpanContext object from the all the HTTP headers

array
inject(SpanContext $context, mixed $container)

Persists the current SpanContext back into the results of this request

formatter()

Returns the current formatter

string
key()

Return the key used to propagate the SpanContext

Details

at line 49
__construct(FormatterInterface $formatter = null, $header = null)

Create a new HttpHeaderPropagator

Parameters

FormatterInterface $formatter
$header

at line 61
SpanContext extract(array $headers)

Generate a SpanContext object from the all the HTTP headers

Parameters

array $headers

Return Value

SpanContext

at line 76
array inject(SpanContext $context, mixed $container)

Persists the current SpanContext back into the results of this request

Parameters

SpanContext $context
mixed $container

Return Value

array

at line 93
FormatterInterface formatter()

Returns the current formatter

Return Value

FormatterInterface

at line 103
string key()

Return the key used to propagate the SpanContext

Return Value

string