Flow PHP

AlwaysOnSampler implements Sampler

Read onlyYes
FinalYes

Sampler that always records and exports all spans.

This is the default sampler and should be used during development or when full observability is required regardless of cost.

Example usage:

$sampler = new AlwaysOnSampler();
$result = $sampler->shouldSample($span);
// Always returns RECORD_AND_SAMPLE

Interfaces

Sampler
Interface for sampling decisions.

Methods

__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