chore: add prometheus metrics

This commit is contained in:
Paul Makles
2023-07-04 17:52:40 +01:00
parent 815c3fe99e
commit 76150db293
10 changed files with 52 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ extern crate serde_json;
pub mod routes;
pub mod util;
use rocket_prometheus::PrometheusMetrics;
use std::net::Ipv4Addr;
use async_std::channel::unbounded;
@@ -65,7 +66,11 @@ async fn rocket() -> _ {
// Configure Rocket
let rocket = rocket::build();
let prometheus = PrometheusMetrics::new();
routes::mount(rocket)
.attach(prometheus.clone())
.mount("/metrics", prometheus)
.mount("/", revolt_quark::web::cors::catch_all_options_routes())
.mount("/", revolt_quark::web::ratelimiter::routes())
.mount("/swagger/", revolt_quark::web::swagger::routes())