From 1fdcec5ca4f7413dbe66a3cad87385cac2250103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Sodr=C3=A9?= Date: Thu, 16 Jan 2025 19:52:34 +0100 Subject: [PATCH] fix(icp-rosetta): fix icp rosetta metrics reponse time (#3480) The `/ metrics` endpoint was returning a `text/html` type, which is rejected by metrics collectors like Prometheus. I've verified that the new type is correctly collected by Prometheus. --- rs/rosetta-api/icp/src/rosetta_server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/rosetta-api/icp/src/rosetta_server.rs b/rs/rosetta-api/icp/src/rosetta_server.rs index 1fb6ca756e2..1b5a93dd3cd 100644 --- a/rs/rosetta-api/icp/src/rosetta_server.rs +++ b/rs/rosetta-api/icp/src/rosetta_server.rs @@ -315,7 +315,7 @@ async fn rosetta_metrics() -> HttpResponse { let encoder = prometheus::TextEncoder::new(); encoder.encode(&metrics, &mut buffer).unwrap(); HttpResponse::Ok() - .content_type("text/html; charset=utf-8") + .content_type("text/plain; version=0.0.4; charset=utf-8") .body(String::from_utf8(buffer).unwrap()) }