pub struct PrometheusHandle { /* private fields */ }
Expand description
Handle for accessing metrics stored via PrometheusRecorder
.
In certain scenarios, it may be necessary to directly handle requests that would otherwise be
handled directly by the HTTP listener, or push gateway background task. PrometheusHandle
allows rendering a snapshot of the current metrics stored by an installed PrometheusRecorder
as a payload conforming to the Prometheus exposition format.
Implementations§
source§impl PrometheusHandle
impl PrometheusHandle
sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Takes a snapshot of the metrics held by the recorder and generates a payload conforming to the Prometheus exposition format.
sourcepub fn run_upkeep(&self)
pub fn run_upkeep(&self)
Performs upkeeping operations to ensure metrics held by recorder are up-to-date and do not grow unboundedly.
Trait Implementations§
source§impl Clone for PrometheusHandle
impl Clone for PrometheusHandle
source§fn clone(&self) -> PrometheusHandle
fn clone(&self) -> PrometheusHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PrometheusHandle
impl RefUnwindSafe for PrometheusHandle
impl Send for PrometheusHandle
impl Sync for PrometheusHandle
impl Unpin for PrometheusHandle
impl UnwindSafe for PrometheusHandle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more