Expand description
§metrics-axum
Axum integration for the metrics-exporter workspace.
Provides:
PrometheusMetrics— shared state holding the registry, HTTP request metrics, and database collector handles. Drop-in for Axum’sState.HttpMetricsLayer— a Tower layer / middleware that automatically recordshttp_requests_total,http_request_duration_seconds, andhttp_requests_in_flightfor every request.metrics_handler— an Axum handler that encodes and serves the Prometheus text exposition format onGET /metrics.health_handler— a simpleGET /healthliveness probe.- Helpers to register the default Prometheus process collector and an optional Tokio runtime collector so they appear alongside the database metrics.
Re-exports§
pub use handler::health_handler;pub use handler::metrics_handler;pub use layer::HttpMetricsLayer;pub use state::PrometheusMetrics;
Modules§
- handler
- Axum handlers for
/metricsand/health. - http_
metrics - layer
- Tower
Layer+Servicethat records HTTP metrics for every request. - state
- Shared application state that ties the Prometheus registry, HTTP metrics, database collectors, and their background tasks together.