From 63ec7ddfed1098619cc0412d0afcf27364f6540a Mon Sep 17 00:00:00 2001 From: Theo Butler Date: Wed, 8 Jan 2025 10:38:30 -0500 Subject: [PATCH] fix: metrics content-type (#1030) This sets the content-type for metrics to `text/plain` instead of `application/octet-stream`. Fixes #1029 --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0a25e366..72683644 100644 --- a/src/main.rs +++ b/src/main.rs @@ -275,9 +275,9 @@ async fn handle_metrics() -> impl axum::response::IntoResponse { tracing::error!(%metrics_encode_err); buffer.clear(); write!(&mut buffer, "Failed to encode metrics").unwrap(); - return (StatusCode::INTERNAL_SERVER_ERROR, buffer); + return (StatusCode::INTERNAL_SERVER_ERROR, Default::default()); } - (StatusCode::OK, buffer) + (StatusCode::OK, String::from_utf8(buffer).unwrap()) } pub fn init_logging(executable_name: &str, json: bool) {