Skip to content

Commit 08db6ef

Browse files
committed
metrics: actually return a 200 status code
For whatever reason the page is returning a 404 status code at the moment. I haven't found exactly why, but this forces the status code on that page to be 200 when metrics are returned.
1 parent 7ef7265 commit 08db6ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/web/metrics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use super::pool::Pool;
22
use iron::headers::ContentType;
33
use iron::prelude::*;
4+
use iron::status::Status;
45
use prometheus::{Encoder, IntGauge, TextEncoder};
56

67
lazy_static! {
@@ -35,6 +36,7 @@ pub fn metrics_handler(req: &mut Request) -> IronResult<Response> {
3536
ctry!(TextEncoder::new().encode(&families, &mut buffer));
3637

3738
let mut resp = Response::with(buffer);
39+
resp.status = Some(Status::Ok);
3840
resp.headers
3941
.set(ContentType("text/plain; version=0.0.4".parse().unwrap()));
4042
Ok(resp)

0 commit comments

Comments
 (0)