1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use axum::{
    body::Body,
    http::Request,
    response::IntoResponse,
};
#[cfg(feature = "metrics")]
use fuel_metrics::service::encode_metrics_response;

pub async fn metrics(_req: Request<Body>) -> impl IntoResponse {
    #[cfg(feature = "metrics")]
    {
        encode_metrics_response()
    }
    #[cfg(not(feature = "metrics"))]
    {
        use axum::http::StatusCode;
        (StatusCode::NOT_FOUND, "Metrics collection disabled")
    }
}