pub struct PrometheusMetricsBuilder { /* private fields */ }Expand description
Builder to create new PrometheusMetrics struct.HistogramVec
It allow set 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 build(self) -> Result<PrometheusMetrics, Error>
pub fn build(self) -> Result<PrometheusMetrics, Error>
Instantiate PrometheusMetrics struct
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