pub struct PrometheusConfig {
pub url: String,
pub timeout: Duration,
pub retries: u32,
pub retry_backoff_ms: u64,
pub min_request_interval_ms: Option<u64>,
pub cache_ttl_secs: Option<u64>,
pub username: Option<String>,
pub password: Option<String>,
}Expand description
Configuration for Prometheus
Fields§
§url: StringURL of the Prometheus server
timeout: DurationTimeout for Prometheus API requests in seconds
retries: u32Number of retries for Prometheus API requests
retry_backoff_ms: u64Backoff between retries in milliseconds
min_request_interval_ms: Option<u64>Minimal interval between requests in milliseconds (simple rate limit)
cache_ttl_secs: Option<u64>Cache TTL for metadata/labels in seconds
username: Option<String>Basic auth username
password: Option<String>Basic auth password
Implementations§
Source§impl PrometheusConfig
impl PrometheusConfig
Sourcepub fn with_timeout(self, timeout_secs: u64) -> Self
pub fn with_timeout(self, timeout_secs: u64) -> Self
Create a new PrometheusConfig with the given timeout
Sourcepub fn with_retries(self, retries: u32) -> Self
pub fn with_retries(self, retries: u32) -> Self
Create a new PrometheusConfig with the given number of retries
Sourcepub fn with_retry_backoff_ms(self, ms: u64) -> Self
pub fn with_retry_backoff_ms(self, ms: u64) -> Self
Set backoff between retries
Sourcepub fn with_min_interval_ms(self, ms: u64) -> Self
pub fn with_min_interval_ms(self, ms: u64) -> Self
Set min request interval (rate limit)
Sourcepub fn with_cache_ttl_secs(self, secs: u64) -> Self
pub fn with_cache_ttl_secs(self, secs: u64) -> Self
Set cache TTL (seconds)
Trait Implementations§
Source§impl Clone for PrometheusConfig
impl Clone for PrometheusConfig
Source§fn clone(&self) -> PrometheusConfig
fn clone(&self) -> PrometheusConfig
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 moreSource§impl Debug for PrometheusConfig
impl Debug for PrometheusConfig
Auto Trait Implementations§
impl Freeze for PrometheusConfig
impl RefUnwindSafe for PrometheusConfig
impl Send for PrometheusConfig
impl Sync for PrometheusConfig
impl Unpin for PrometheusConfig
impl UnwindSafe for PrometheusConfig
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