Configure Samplers
masterSamplers determine which requests are traced. The following sampler types are supported via the sampler configuration key:
Const Sampler
Traces everything or nothing based on a boolean parameter.
type:Jaeger\SAMPLER_TYPE_CONSTparam:true(trace) orfalse(don't trace)
Probabilistic Sampler
Traces requests based on a given rate.
type:Jaeger\SAMPLER_TYPE_PROBABILISTICparam: A float between0.0and1.0.
Rate Limiting Sampler
Traces a maximum number of requests per second. Requirements:
- A
psr/cache(PSR-6) implementation passed to theConfigconstructor. - PHP 7.3+ or the
PECL/hrtimeextension. type:Jaeger\SAMPLER_TYPE_RATE_LIMITINGparam: An integer representing max traces per second.cache: An array containingcurrentBalanceKeyandlastTickKey(strings) to store state.
// Const Sampler Example
'sampler' => [
'type' => Jaeger\SAMPLER_TYPE_CONST,
'param' => true,
],
// Probabilistic Sampler Example
'sampler' => [
'type' => Jaeger\SAMPLER_TYPE_PROBABILISTIC,
'param' => 0.5,
],
// Rate Limiting Sampler Example
'sampler' => [
'type' => Jaeger\SAMPLER_TYPE_RATE_LIMITING,
'param' => 100,
'cache' => [
'currentBalanceKey' => 'rate.currentBalance',
'lastTickKey' => 'rate.lastTick'
]
],