feature: expand nym-node prometheus metrics (#5298)

* fixed bearer auth for prometheus route

* basic prometheus metrics

* added rates on global values

* improved structure on the prometheus metrics

* added additional metrics for ingress websockets and egress mixnet connections

* some channel business metrics

* fixed metrics registration and added additional variants

* added counter for number of disk persisted packets

* counter for pending egress packets

* counter for pending egress forward packets

* clippy
This commit is contained in:
Jędrzej Stuczyński
2024-12-20 10:32:56 +00:00
parent c482350ec6
commit 3efeededc5
38 changed files with 1741 additions and 256 deletions
-2
View File
@@ -9,8 +9,6 @@ pub use nym_verloc::measurements::metrics::SharedVerlocStats;
#[derive(Clone)]
pub struct MetricsAppState {
pub(crate) prometheus_access_token: Option<String>,
pub(crate) metrics: NymNodeMetrics,
pub(crate) verloc: SharedVerlocStats,
+1 -11
View File
@@ -24,17 +24,7 @@ impl AppState {
// does it have to be?
// also no.
startup_time: Instant::now(),
metrics: MetricsAppState {
prometheus_access_token: None,
metrics,
verloc,
},
metrics: MetricsAppState { metrics, verloc },
}
}
#[must_use]
pub fn with_metrics_key(mut self, bearer_token: impl Into<Option<String>>) -> Self {
self.metrics.prometheus_access_token = bearer_token.into();
self
}
}