pub struct PrometheusMetricsBuilder { /* private fields */ }Expand description
Builder to create new PrometheusMetrics struct.HistogramVec
It allows setting optional parameters like registry, buckets, etc.
Implementations§
Source§impl PrometheusMetricsBuilder
impl PrometheusMetricsBuilder
Sourcepub fn new(namespace: &str) -> Self
pub fn new(namespace: &str) -> Self
Create new PrometheusMetricsBuilder
namespace example: “actix”
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 registry(self, value: Registry) -> Self
pub fn registry(self, value: Registry) -> Self
Set registry
By default one is set and is internal to PrometheusMetrics
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
Sourcepub fn metrics_configuration(self, value: ActixMetricsConfiguration) -> Self
pub fn metrics_configuration(self, value: ActixMetricsConfiguration) -> Self
Set metrics configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrometheusMetricsBuilder
impl !RefUnwindSafe for PrometheusMetricsBuilder
impl Send for PrometheusMetricsBuilder
impl Sync for PrometheusMetricsBuilder
impl Unpin for PrometheusMetricsBuilder
impl !UnwindSafe for PrometheusMetricsBuilder
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