Skip to main content

initialize_metrics

Function initialize_metrics 

Source
pub async fn initialize_metrics(
    metrics_prefix: String,
) -> Result<(FilterHandle, MetricsFlusherWorker), GenericError>
Expand description

Initializes the metrics subsystem with the given metrics prefix.

Returns a FilterHandle for adjusting the runtime metrics filter, plus a MetricsFlusherWorker that must be added to a Supervisor in order to drive the periodic flush loop. Internal metrics are not propagated to subscribers until the worker is running.

ยงErrors

If a global recorder was already installed, an error will be returned.