Skip to main content

Module metrics

Module metrics 

Source
Expand description

Pluggable metrics sink.

The framework emits structured counters / gauges / histograms at every observable event. Host services plug in a MetricsSink implementation to ship them somewhere — Prometheus, StatsD, an in-process accumulator, anything.

The default NoopSink discards everything.

§Why a trait, not a global registry

Different host services own different metrics backends. The bot is an embedded library; forcing a particular metrics layer would force every downstream consumer onto that layer. A small trait is cheap and lets the host stay in control.

Structs§

NoopSink
Default sink that discards everything. Lower overhead than even a tracing::trace! call.

Traits§

MetricsSink
Push-based metrics interface.