opentracing-0.3.0: OpenTracing for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTracing.Sampling

Description

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

Documentation

newtype Sampler Source #

A Sampler is an algorithm for determine if a trace should be reported.

Constructors

Sampler 

Fields

constSampler :: Bool -> Sampler Source #

A Sampler that always returns the given value. Useful for debug environments.

probSampler Source #

Arguments

:: Double

A probability percentage, between 0.0 and 1.0

-> Sampler 

A Sampler that randomly chooses to report a given percentage of traces. The source of randomness is the ID of the trace.

rateLimitSampler Source #

Arguments

:: Double

Traces per second

-> IO Sampler 

A Sampler that will report the given number of traces per second.