function TraceIdRatioBasedSampler::__construct
Parameters
float $probability Probability float value between 0.0 and 1.0.:
File
-
vendor/
open-telemetry/ sdk/ Trace/ Sampler/ TraceIdRatioBasedSampler.php, line 29
Class
- TraceIdRatioBasedSampler
- This implementation of the SamplerInterface records with given probability. Example: ``` use OpenTelemetry\API\Trace\TraceIdRatioBasedSampler; $sampler = new TraceIdRatioBasedSampler(0.01); ```
Namespace
OpenTelemetry\SDK\Trace\SamplerCode
public function __construct(float $probability) {
if ($probability < 0.0 || $probability > 1.0) {
throw new InvalidArgumentException('probability should be be between 0.0 and 1.0.');
}
$this->probability = $probability;
}