pub struct MetricsServer { /* private fields */ }
Expand description
Http server with graceful shutdown that serves prometheus metrics
Runs in a separate tokio task
Implementations§
Source§impl MetricsServer
impl MetricsServer
Sourcepub fn new(bind_addr: SocketAddr) -> Self
pub fn new(bind_addr: SocketAddr) -> Self
Create new server with prometheus default registry. This will spawn a new tokio task.
§Arguments
registry
- prometheus registry to gather metrics frombind_addr
- address to bind server to
Sourcepub fn new_with_registry(registry: Registry, bind_addr: SocketAddr) -> Self
pub fn new_with_registry(registry: Registry, bind_addr: SocketAddr) -> Self
Create new server with a given registry. This will spawn a new tokio task.
§Arguments
registry
- prometheus registry to gather metrics frombind_addr
- address to bind server to
Auto Trait Implementations§
impl Freeze for MetricsServer
impl !RefUnwindSafe for MetricsServer
impl Send for MetricsServer
impl Sync for MetricsServer
impl Unpin for MetricsServer
impl !UnwindSafe for MetricsServer
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