Flow PHP

Propagator

Interface for propagating context across process boundaries.

Propagator defines how context information (like trace identifiers and baggage) is injected into and extracted from carriers such as HTTP headers, gRPC metadata, or message queue headers.

Example usage:

$propagator = new W3CTraceContext();

// Extract context from incoming request headers
$carrier = new ArrayCarrier($incomingHeaders);
$ctx = $propagator->extract($carrier);

// Inject context into outgoing request headers
$carrier = new ArrayCarrier();
$propagator->inject($ctx, $carrier);
$headers = $carrier->toArray();

Methods

extract()  : PropagationContext
Extract context from a carrier.
fields()  : array<string|int, string>
Get the list of header/field names this propagator uses.
inject()  : void
Inject context into a carrier.

Methods

fields()

Get the list of header/field names this propagator uses.

public fields() : array<string|int, string>

This is useful for CORS configuration and carrier filtering.

Return values
array<string|int, string>

List of field names


        
On this page

Search results