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
$baggage
public
Baggage|null
$baggage
= null
$spanContext
public
SpanContext|null
$spanContext
= null
Methods
__construct()
public
__construct([SpanContext|null $spanContext = null ][, Baggage|null $baggage = null ]) : mixed
Parameters
- $spanContext : SpanContext|null = null
- $baggage : Baggage|null = null
merge()
Merge this context with another, preferring values from the other context.
public
merge(self $other) : self
Parameters
- $other : self
Return values
selfwithBaggage()
Create a new context with a different baggage.
public
withBaggage(Baggage|null $baggage) : self
Parameters
- $baggage : Baggage|null
Return values
selfwithSpanContext()
Create a new context with a different span context.
public
withSpanContext(SpanContext|null $spanContext) : self
Parameters
- $spanContext : SpanContext|null