Skip to main content

install

Function install 

Source
pub fn install() -> Result<PrometheusHandle, ProxyError>
Expand description

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.

ยงErrors

Returns ProxyError::Internal if the first install fails (e.g. a different metrics recorder is already installed in-process).