Flow PHP

AttributeMatchingSampler implements Sampler

Read onlyYes
FinalYes

Drops spans whose start-time attributes match an {@see AttributeFilter}, and defers every other span to a delegate sampler.

The decision is made at span start, so a matched span becomes non-recording and is never handed to a processor or exporter (no attributes accumulate, no onEnd).

Only attributes available at span start are visible here - attributes added during the span's lifetime (status codes, durations) are not. End-state filtering remains the job of a span processor or tail sampling.

The matcher tree, its compiled drop closure, the inspected AttributeSources and the exclude polarity are all reused from the shared AttributeFilter: a match drops the span (AttributeFilter::$exclude true, the default) or keeps ONLY matching spans (exclude false).

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

__toString()

Get a string representation of this sampler for debugging.

public __toString() : string

Examples:

  • "AlwaysOnSampler"
  • "TraceIdRatioBasedSampler{0.001}"
  • "ParentBased{root=AlwaysOnSampler}"
Return values
string
On this page

Search results