Skip to main content

Module metrics

Module metrics 

Source
Expand description

Prometheus metrics: install the global recorder once per process and serve GET /metrics for scraping. Real signals only โ€” latency, escalations, what got served, what dropped.

Functionsยง

handler
GET /metrics โ€” render the current Prometheus scrape payload.
install
Install the global Prometheus recorder, once per process, and return a handle that renders the scrape payload. Safe to call more than once: OnceLock::get_or_init runs the install exactly once even under concurrent callers, so repeat calls (e.g. from every test that builds an crate::proxy::app) just reuse the cached handle instead of re-installing.