Skip to content

Commit

Permalink
fix(icp-rosetta): fix icp rosetta metrics reponse time (#3480)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fsodre authored Jan 16, 2025
1 parent a274a85 commit 1fdcec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rs/rosetta-api/icp/src/rosetta_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 1fdcec5

Please sign in to comment.