Skip to content

Commit da596fd

Browse files
committed
fix: add missing content-type for prometheus exporter
1 parent 8bb355f commit da596fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/exporters/prometheus.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,13 @@ async fn show_metrics(
232232
} else {
233233
let _ = write!(body, "<a href=\"https://github.com/hubblo-org/scaphandre/\">Scaphandre's</a> prometheus exporter here. Metrics available on <a href=\"/{suffix}\">/{suffix}</a>");
234234
}
235-
Ok(Response::new(body.into()))
235+
236+
let mut response = Response::new(body.into());
237+
response.headers_mut().insert(
238+
hyper::header::CONTENT_TYPE,
239+
hyper::header::HeaderValue::from_static("text/plain; version=0.0.4"),
240+
);
241+
Ok(response)
236242
}
237243

238244
// Copyright 2020 The scaphandre authors.

0 commit comments

Comments
 (0)