Struct PrometheusHandle
pub struct PrometheusHandle {
inner: Arc<Inner>,
}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.
Fields§
§inner: Arc<Inner>Implementations§
§impl PrometheusHandle
impl PrometheusHandle
pub 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.
pub 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§
§impl Clone for PrometheusHandle
impl Clone for PrometheusHandle
§fn clone(&self) -> PrometheusHandle
fn clone(&self) -> PrometheusHandle
Returns a duplicate 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more