run_metrics_server

Function run_metrics_server 

Source
pub async fn run_metrics_server(
    config: MetricsConfig,
) -> Result<Arc<EnhancedMetricsProvider>>
Expand description

Runs a standalone metrics server with the given configuration.

This function initializes the metrics collection infrastructure and starts a metrics server that exposes collected metrics via HTTP endpoints compatible with Prometheus scraping. It also initializes the background tasks for collecting system and application metrics at regular intervals.

§Parameters

  • config - Configuration for metrics collection, retention, and server settings

§Returns

A reference to the initialized and started metrics provider on success

§Errors

Returns an error if the metrics provider initialization or server startup fails