class GrpcMetadataPropagator implements PropagatorInterface

This propagator contains the logic for propagating SpanContext over grpc using its request metadata. It will default to using the BinaryFormatter to serialize/deserialize SpanContext.

Constants

DEFAULT_METADATA_KEY

Methods

__construct(FormatterInterface $formatter = null, string $key = null)

Create a new GrpcMetadataPropagator

extract(array $metadata)

Generate a SpanContext object from the all the HTTP headers

array
inject(SpanContext $context, $metadata)

Persiste the current SpanContext back into the results of this request

formatter()

Fetch the formatter for propagating the SpanContext

string
key()

Return the key used to propagate the SpanContext

Details

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

Create a new GrpcMetadataPropagator

Parameters

FormatterInterface $formatter [optional] The formatter used to serialize/deserialize SpanContext Defaults to a new BinaryFormatter.
string $key [optional] The grpc metadata key to store/retrieve the encoded SpanContext. Defaults to grpc-trace-bin

at line 61
SpanContext extract(array $metadata)

Generate a SpanContext object from the all the HTTP headers

Parameters

array $metadata

Return Value

SpanContext

at line 76
array inject(SpanContext $context, $metadata)

Persiste the current SpanContext back into the results of this request

Parameters

SpanContext $context
$metadata

Return Value

array

at line 87
FormatterInterface formatter()

Fetch the formatter for propagating the SpanContext

Return Value

FormatterInterface

at line 97
string key()

Return the key used to propagate the SpanContext

Return Value

string