Flow PHP

AlwaysOffSampler implements Sampler

Read onlyYes
FinalYes

Sampler that never records or exports any spans.

This sampler is useful for completely disabling tracing in production or for specific paths that should never be traced.

Example usage:

$sampler = new AlwaysOffSampler();
$result = $sampler->shouldSample($span);
// Always returns DROP

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