feat: add prometheus monitor
This commit is contained in:
@@ -3,6 +3,7 @@ use nanobyte_tera::{hosts::static_filter, l18n::translate_filter, date::{calcula
|
||||
use ovlach_tera::entity::lang_entity;
|
||||
use rocket::{*, fairing::{AdHoc, Fairing}};
|
||||
use rocket_dyn_templates::Template;
|
||||
use rocket_prometheus::PrometheusMetrics;
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
use tools::tera::advanced_filter;
|
||||
|
||||
@@ -58,6 +59,8 @@ pub fn rocket_builder() -> Rocket<Build> {
|
||||
// extract the entire config any `Deserialize` value
|
||||
//let config: PresentationConfig = figment.extract().expect("config");
|
||||
|
||||
let prometheus = PrometheusMetrics::new();
|
||||
|
||||
rocket.attach(
|
||||
template_fairing()
|
||||
).attach(
|
||||
@@ -70,8 +73,12 @@ pub fn rocket_builder() -> Rocket<Build> {
|
||||
AdHoc::config::<FrontendSVCConfig>()
|
||||
).attach(
|
||||
nanobyte_opentelemetry::rocket::TracingFairing::ignite()
|
||||
).mount("/", routes![
|
||||
).attach(
|
||||
prometheus.clone()
|
||||
)
|
||||
.mount("/", routes![
|
||||
routes::root::index,
|
||||
routes::root::index_without_lang
|
||||
])
|
||||
.mount("/metrics", prometheus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user