Flow PHP

PropagationContext

Read onlyYes
FinalYes

Value object containing propagated context information.

PropagationContext holds both trace context (SpanContext) and application data (Baggage) that can be propagated across process boundaries.

Example usage:

$propagator = new CompositePropagator([
    new W3CTraceContext(),
    new W3CBaggage(),
]);

$ctx = $propagator->extract($carrier);
$spanContext = $ctx->spanContext;
$baggage = $ctx->baggage;

Properties

$baggage  : Baggage|null
$spanContext  : SpanContext|null

Methods

__construct()  : mixed
merge()  : self
Merge this context with another, preferring values from the other context.
withBaggage()  : self
Create a new context with a different baggage.
withSpanContext()  : self
Create a new context with a different span context.

Properties

Methods

merge()

Merge this context with another, preferring values from the other context.

public merge(self $other) : self
Parameters
$other : self
Return values
self

withBaggage()

Create a new context with a different baggage.

public withBaggage(Baggage|null $baggage) : self
Parameters
$baggage : Baggage|null
Return values
self

withSpanContext()

Create a new context with a different span context.

public withSpanContext(SpanContext|null $spanContext) : self
Parameters
$spanContext : SpanContext|null
Return values
self

        
On this page

Search results