Skip to main content

Module sampling

Module sampling 

Source
Expand description

Rate-based log sampling layer. Rate-based log sampling layer.

Limits log throughput per level to prevent log storms in production. After an initial burst of messages the layer drops a configurable fraction of events, keeping resource usage predictable.

§Example

use rskit_logging::sampling::SamplingConfig;

let cfg = SamplingConfig { enabled: true, initial_rate: 50, thereafter_rate: 10 };
assert!(cfg.enabled);

Structs§

SamplingConfig
Configuration for log sampling.
SamplingLayer
A tracing_subscriber::Layer that drops events exceeding per-level rate limits.