pub struct ActixWebMetricsBuilder { /* private fields */ }
Expand description
Builder to create new ActixWebMetrics
struct.
Implementations§
Source§impl ActixWebMetricsBuilder
impl ActixWebMetricsBuilder
Sourcepub fn const_labels(self, value: HashMap<String, String>) -> Self
pub fn const_labels(self, value: HashMap<String, String>) -> Self
Set labels to add on every metrics
Sourcepub fn exclude<T: Into<String>>(self, path: T) -> Self
pub fn exclude<T: Into<String>>(self, path: T) -> Self
Ignore and do not record metrics for specified path.
Sourcepub fn exclude_regex<T: Into<String>>(self, path: T) -> Self
pub fn exclude_regex<T: Into<String>>(self, path: T) -> Self
Ignore and do not record metrics for paths matching the regex.
Sourcepub fn exclude_status<T: Into<StatusCode>>(self, status: T) -> Self
pub fn exclude_status<T: Into<StatusCode>>(self, status: T) -> Self
Ignore and do not record metrics for paths returning the status code.
Sourcepub fn mask_unmatched_patterns<T: Into<String>>(self, mask: T) -> Self
pub fn mask_unmatched_patterns<T: Into<String>>(self, mask: T) -> Self
Replaces the request path with the supplied mask if no actix-web handler is matched
Defaults to UNKNOWN
Sourcepub fn disable_unmatched_pattern_masking(self) -> Self
pub fn disable_unmatched_pattern_masking(self) -> Self
Disable masking of unmatched patterns.
WARNING:This may lead to unbounded cardinality for unmatched requests. (potential DoS)
Sourcepub fn metrics_config(self, value: ActixWebMetricsConfig) -> Self
pub fn metrics_config(self, value: ActixWebMetricsConfig) -> Self
Set metrics configuration
Sourcepub fn build(self) -> ActixWebMetrics
pub fn build(self) -> ActixWebMetrics
Instantiate ActixWebMetrics
struct
WARNING: This call purposefully leaks the memory of metrics and label names to avoid allocations during runtime. Avoid calling more than once.
Trait Implementations§
Source§impl Debug for ActixWebMetricsBuilder
impl Debug for ActixWebMetricsBuilder
Auto Trait Implementations§
impl Freeze for ActixWebMetricsBuilder
impl RefUnwindSafe for ActixWebMetricsBuilder
impl Send for ActixWebMetricsBuilder
impl Sync for ActixWebMetricsBuilder
impl Unpin for ActixWebMetricsBuilder
impl UnwindSafe for ActixWebMetricsBuilder
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