pub struct PrometheusBuilder { /* private fields */ }Expand description
Builder for easy Prometheus server setup
Implementations§
Source§impl PrometheusBuilder
impl PrometheusBuilder
Sourcepub const fn bind_address(self, addr: SocketAddr) -> Self
pub const fn bind_address(self, addr: SocketAddr) -> Self
Set the bind address
Sourcepub fn metrics_path<S: Into<String>>(self, path: S) -> Self
pub fn metrics_path<S: Into<String>>(self, path: S) -> Self
Set the metrics path
Sourcepub const fn system_metrics(self, enabled: bool) -> Self
pub const fn system_metrics(self, enabled: bool) -> Self
Enable or disable system metrics
Sourcepub const fn system_metrics_interval(self, seconds: u64) -> Self
pub const fn system_metrics_interval(self, seconds: u64) -> Self
Set system metrics update interval
Sourcepub fn build_with_cdk_metrics(self) -> Result<PrometheusServer>
pub fn build_with_cdk_metrics(self) -> Result<PrometheusServer>
Build the server with specific CDK metrics instance
§Errors
Returns an error if system metrics cannot be created (when enabled)
Sourcepub fn build_with_registry(self, registry: Arc<Registry>) -> PrometheusServer
pub fn build_with_registry(self, registry: Arc<Registry>) -> PrometheusServer
Build the server with custom registry
Trait Implementations§
Source§impl Debug for PrometheusBuilder
impl Debug for PrometheusBuilder
Auto Trait Implementations§
impl Freeze for PrometheusBuilder
impl RefUnwindSafe for PrometheusBuilder
impl Send for PrometheusBuilder
impl Sync for PrometheusBuilder
impl Unpin for PrometheusBuilder
impl UnwindSafe for PrometheusBuilder
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> 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>
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