Safe Haskell | None |
---|---|
Language | Haskell2010 |
Distributed traces are sampled, meaning they (and the spans that make them up) are selected to either be reported or not.
This module defines a few different ways to determine if a given trace should be sampled.
Synopsis
- newtype Sampler = Sampler {
- runSampler :: forall m. MonadIO m => TraceID -> Text -> m Bool
- constSampler :: Bool -> Sampler
- probSampler :: Double -> Sampler
- rateLimitSampler :: Double -> IO Sampler
Documentation
A Sampler
is an algorithm for determine if a trace should be reported.
constSampler :: Bool -> Sampler Source #
A Sampler
that always returns the given value. Useful for debug environments.
A Sampler
that randomly chooses to report a given percentage of traces. The
source of randomness is the ID of the trace.