Skip to content

Commit

Permalink
fix: metrics content-type (#1030)
Browse files Browse the repository at this point in the history
This sets the content-type for metrics to `text/plain` instead of
`application/octet-stream`.

Fixes #1029
  • Loading branch information
Theodus authored Jan 8, 2025
1 parent a99e209 commit 63ec7dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 63ec7dd

Please sign in to comment.