-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/metrics endpoint is resolving but no metrics are displayed #21
Comments
I can't see anything wrong with your setup in the code snippet you've posted, but it's difficult to reproduce such a complicated example. I've never noticed any issues like that in my apps. The only thing I can think of is to try changing the order of your mounts: perhaps the |
thanks for responding so quickly.. Unfortunately, that didn't make any
difference.
I just get this in the rocket log
2023-06-22T19:12:20.673Z INFO [rocket::server] GET /metrics text/html:
2023-06-22T19:12:20.673Z INFO [rocket::server::_] Matched: GET /metrics/
2023-06-22T19:12:20.673Z INFO [rocket::server::_] Outcome: Success
2023-06-22T19:12:20.673Z INFO [rocket::server::_] Response succeeded
I set the RUST_LOG=debug but not additional information.
…On Thu, Jun 22, 2023 at 12:40 PM Ben Sully ***@***.***> wrote:
I can't see anything wrong with your setup in the code snippet you've
posted, but it's difficult to reproduce such a complicated example. I've
never noticed any issues like that in my apps. The only thing I can think
of is to try changing the order of your mounts: perhaps the .register("/",
catchers!(rocket_governor_catcher) should be after the .mount() calls?
—
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMZ4PKCP5EIYTBTVOEMUVLXMRYOZANCNFSM6AAAAAAZQOHC7U>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi, I encountered the same issue, and made the same mistake than you @mark-e-hoffman 😄 You added the prometheus fairing as a managed state (https://rocket.rs/v0.5-rc/guide/state/#managed-state) by doing: .manage(prometheus.clone()) You should use .attach(prometheus.clone()) |
Good catch @Rauks! Thanks for replying here, glad you found the cause. I'm not even sure there's a good way of avoiding that, unless I split the struct up into 2 somehow... I'll give it some thought. |
I'm using version = "0.10.0-rc.3" and my rocket webserver will resolve /metrics but there is no data returned, even though I have sent several GET AND POST requests to my server.
rocket::build()
.attach(AdHoc::config::())
.manage(pool)
.manage(replier)
.manage(prometheus.clone())
.manage(amqp_pool)
.attach(rocket_governor::LimitHeaderGen::default())
.register("/", catchers!(rocket_governor_catcher)) // catches limit errors and produces a 429 error code
.mount("/ref", routes![refs::get,refs::patch, refs::delete, refs::post, refs::get_all])
.mount("/device", routes![device::get,device::patch, device::delete, device::post, device::get_all])
.mount("/library", routes![library::get,library::patch, library::delete, library::post, library::get_all, library::link_ref_item_to_library, library::get_ref_item_in_library])
.mount("/session", routes![session::get,session::patch, session::delete, session::post, session::get_all])
.mount("/project", routes![project::get,project::patch, project::delete, project::post, project::get_all,project::link_library_to_project, project::get_library_in_project,project::match_detections])
.mount("/metrics", prometheus)
.launch().await?;
The text was updated successfully, but these errors were encountered: