Add Prometheus /metrics HTTP endpoint

Wire up unused metrics_port/metrics_whitelist config into working
HTTP server exposing proxy stats in Prometheus text format.
This commit is contained in:
Mikhail
2026-02-17 01:11:01 +03:00
parent 9b9c11e7ab
commit a1db082ec0
6 changed files with 217 additions and 0 deletions

View File

@@ -97,6 +97,12 @@ impl Stats {
.unwrap_or(0)
}
pub fn get_handshake_timeouts(&self) -> u64 { self.handshake_timeouts.load(Ordering::Relaxed) }
pub fn iter_user_stats(&self) -> dashmap::iter::Iter<'_, String, UserStats> {
self.user_stats.iter()
}
pub fn uptime_secs(&self) -> f64 {
self.start_time.read()
.map(|t| t.elapsed().as_secs_f64())