pub struct REGISTRY { /* private fields */ }Expand description
Global Prometheus registry.
This registry holds all metrics defined in this module and is used to gather metrics for exposure via the metrics endpoint.
Methods from Deref<Target = Registry>§
pub fn register(&self, c: Box<dyn Collector>) -> Result<(), Error>
pub fn register(&self, c: Box<dyn Collector>) -> Result<(), Error>
register registers a new [Collector] to be included in metrics
collection. It returns an error if the descriptors provided by the
[Collector] are invalid or if they — in combination with descriptors of
already registered Collectors — do not fulfill the consistency and
uniqueness criteria described in the documentation of Desc.
If the provided [Collector] is equal to a [Collector] already registered
(which includes the case of re-registering the same [Collector]), the
AlreadyReg error returns.
pub fn unregister(&self, c: Box<dyn Collector>) -> Result<(), Error>
pub fn unregister(&self, c: Box<dyn Collector>) -> Result<(), Error>
unregister unregisters the [Collector] that equals the [Collector] passed
in as an argument. (Two Collectors are considered equal if their
Describe method yields the same set of descriptors.) The function
returns error when the [Collector] is not registered.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for REGISTRY
impl RefUnwindSafe for REGISTRY
impl Send for REGISTRY
impl Sync for REGISTRY
impl Unpin for REGISTRY
impl UnwindSafe for REGISTRY
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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