OpenTelemetry PHP

ComposableProbability
in package
implements ComposableSamplerInterface

FinalYes

Samples spans with a fixed probability.

A ratio of 0 (or one so small that it rounds to a rejection threshold of 2^56) behaves like ComposableAlwaysOff, as the specification recommends.

Tags
experimental

Table of Contents

Interfaces

ComposableSamplerInterface
A sampler that returns its sampling preference (a {@see SamplingIntentInterface}) instead of a decision.

Properties

$description  : string
$intent  : SamplingIntentInterface

Methods

__construct()  : mixed
getDescription()  : string
getSamplingIntent()  : SamplingIntentInterface

Properties

Methods

__construct()

public __construct(float $ratio) : mixed
Parameters
$ratio : float

Sampling probability in [0, 1]

Tags
throws
InvalidArgumentException

if the ratio is out of range

getDescription()

public getDescription() : string
Attributes
#[Override]
Return values
string
On this page

Search results