SuppressingSampler implements Sampler
Read onlyYes
FinalYes
Enforces OpenTelemetry tracing suppression as a Sampler: when the parent context carries the suppression bit, the span is dropped (non-recording, never exported); otherwise the decision is deferred to the wrapped sampler.
This is the single enforcement point for the context-scoped suppression key, composed over whatever sampler is configured, so suppression takes precedence over any sampling strategy.
Interfaces
- Sampler
- Interface for sampling decisions.
Methods
- __construct() : mixed
- __toString() : string
- Get a string representation of this sampler for debugging.
- shouldSample() : SamplingResult
- Determine if a span should be sampled.
Methods
__construct()
public
__construct(Sampler $inner) : mixed
Parameters
- $inner : Sampler
__toString()
Get a string representation of this sampler for debugging.
public
__toString() : string
Examples:
- "AlwaysOnSampler"
- "TraceIdRatioBasedSampler{0.001}"
- "ParentBased{root=AlwaysOnSampler}"
Return values
stringshouldSample()
Determine if a span should be sampled.
public
shouldSample(Context $parentContext, Span $span) : SamplingResult
Parameters
- $parentContext : Context
-
The parent context of the span to be created
- $span : Span
-
The span to evaluate for sampling
Return values
SamplingResult —The sampling decision