- Defined in:
A sampler determines whether a given request's latency trace should actually be reported. It is usually not necessary to trace every request, especially for an application serving heavy traffic. You may use a sampler to decide, for a given request, whether to report its trace.
The OpenCensus specification defines four samplers:, , , and .
A sampler is a
Proc that takes a hash of environment information and
returns a boolean indicating whether or not to sample the current
request. Alternately, it could be an object that duck-types the
interface by implementing the
call method. The hash passed to
may contain the following keys, all of which are optional. Samplers must
adjust their behavior to account for the availability or absence of any
span_contextThe that created the span being sampled.
rack_envThe hash of Rack environment information
Applications may set a default sampler in the config. In addition, the sampler may be overridden whenever a span is created.
Defined Under Namespace
Classes:, , ,
Constant Summary collapse
- MaxQPS =
MaxQPS is an older, deprecated name for the RateLimiting sampler.