pub struct MetricsConfig {
pub enabled: bool,
pub bind_address: String,
pub path: String,
pub basic_auth: Option<MetricsBasicAuthConfig>,
}Expand description
Prometheus metrics scrape endpoint configuration.
Fields§
§enabled: boolRequired. When true, the metrics HTTP endpoint is started on
bind_address.
bind_address: StringRequired. Socket address on which the metrics HTTP server listens
(e.g. "0.0.0.0:9090"). Must contain a colon separating host and port.
path: StringRequired. URL path at which Prometheus can scrape metrics
(e.g. "/metrics"). Must start with '/'.
basic_auth: Option<MetricsBasicAuthConfig>Optional HTTP Basic auth on the scrape endpoint.
When present, the metrics handler verifies the Authorization: Basic
header against the configured bcrypt hash (RFC 7617). Returns 401 on
missing/invalid credentials.
Implementations§
Source§impl MetricsConfig
impl MetricsConfig
Sourcepub fn validate_bind_address(&self) -> Result<()>
pub fn validate_bind_address(&self) -> Result<()>
Validate bind address format.
Sourcepub fn validate_path(&self) -> Result<()>
pub fn validate_path(&self) -> Result<()>
Validate path format.
Trait Implementations§
Source§impl Clone for MetricsConfig
impl Clone for MetricsConfig
Source§fn clone(&self) -> MetricsConfig
fn clone(&self) -> MetricsConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricsConfig
impl Debug for MetricsConfig
Source§impl<'de> Deserialize<'de> for MetricsConfig
impl<'de> Deserialize<'de> for MetricsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MetricsConfig
impl RefUnwindSafe for MetricsConfig
impl Send for MetricsConfig
impl Sync for MetricsConfig
impl Unpin for MetricsConfig
impl UnsafeUnpin for MetricsConfig
impl UnwindSafe for MetricsConfig
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