use axum::{extract::State, response::IntoResponse}; use metrics_exporter_prometheus::{PrometheusBuilder, PrometheusHandle}; pub fn init() -> PrometheusHandle { PrometheusBuilder::new() .install_recorder() .expect("install prometheus recorder") } pub async fn render(State(handle): State) -> impl IntoResponse { handle.render() }