Open vbmade2000 opened 3 years ago
Reordering the .wrap
calls to do prom first then the logger fixes this up for me so may be worth a shot for you if your ordering is flipped as well. Sorry too lazy to root around through the code to understand why.
let prometheus = PrometheusMetrics::new("api", Some("/metrics"), Some(labels));
HttpServer::new(move || {
App::new()
.wrap(prometheus.clone())
.wrap(Logger::default())
.service(web::resource("/health").to(health))
})
.bind("127.0.0.1:8080")?
.run()
.await?;
There's definitely an issue somewhere. Using NormalizePath middleware returns 404, but there's no output.
@dpn I'll check your solution. Thanks.
Description: Whenever /metrics is curled, internally it shows 404 return code even if the URL /metrics exists and gives output. Also that 404 code is not seen in /metrics output. It shows 200 only.
Rust Version: rustc 1.46.0-nightly (f781babf8 2020-07-01)
Cargo Version: cargo 1.46.0-nightly (c26576f9a 2020-06-23)
Actix Web Version: 3.1.0
actix-web-prom Version: 0.5.0