Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data SamplingState
- samplingStateToHeader :: IsString s => SamplingState -> Maybe s
- samplingStateFromHeader :: (IsString s, Eq s) => Maybe s -> SamplingState
- data SamplingDecision
- type SamplingPolicy = IO SamplingDecision
- sampleNever :: SamplingPolicy
- sampleAlways :: SamplingPolicy
- sampleRandomly :: Double -> SamplingPolicy
- sampleOneInN :: Refined Positive Int -> SamplingPolicy
Documentation
data SamplingState Source #
B3 propagation sampling state.
Debug sampling state not represented.
samplingStateToHeader :: IsString s => SamplingState -> Maybe s Source #
Convert a sampling state to a value for the X-B3-Sampled header. A return value of Nothing indicates that the header should not be set.
samplingStateFromHeader :: (IsString s, Eq s) => Maybe s -> SamplingState Source #
Convert a X-B3-Sampled header value to a sampling state. An input of Nothing indicates that the header was not set.
data SamplingDecision Source #
A local decision about whether or not to sample spans.
type SamplingPolicy = IO SamplingDecision Source #
An IO action for deciding whether or not to sample a trace.
Currently restricted to deny access to the B3 sampling state, but we may want to be more flexible in the future.