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§
- Sampling
Config - Configuration for log sampling.
- Sampling
Layer - A
tracing_subscriber::Layerthat drops events exceeding per-level rate limits.