pub struct PrometheusBuilder { /* private fields */ }
Expand description
Builder for PrometheusObserver
.
Implementations§
Source§impl PrometheusBuilder
impl PrometheusBuilder
Sourcepub fn new() -> PrometheusBuilder
pub fn new() -> PrometheusBuilder
Creates a new PrometheusBuilder
with default values.
Sourcepub fn set_quantiles(self, quantiles: &[f64]) -> PrometheusBuilder
pub fn set_quantiles(self, quantiles: &[f64]) -> PrometheusBuilder
Sets the quantiles to use when rendering histograms.
Quantiles represent a scale of 0 to 1, where percentiles represent a scale of 1 to 100, so a quantile of 0.99 is the 99th percentile, and a quantile of 0.99 is the 99.9th percentile.
By default, the quantiles will be set to: 0.0, 0.5, 0.9, 0.95, 0.99, 0.999, and 1.0.
Sourcepub fn set_buckets(self, values: &[u64]) -> PrometheusBuilder
pub fn set_buckets(self, values: &[u64]) -> PrometheusBuilder
Sets the buckets to use when rendering summaries.
Buckets values represent the higher bound of each buckets.
This option changes the observer’s output of histogram-type metric into summaries.
Sourcepub fn set_buckets_for_metric(
self,
name: &str,
values: &[u64],
) -> PrometheusBuilder
pub fn set_buckets_for_metric( self, name: &str, values: &[u64], ) -> PrometheusBuilder
Sets the buckets for a specific metric, overidding the default.
Matches the metric name’s suffix, the longest match will be used.
This option changes the observer’s output of histogram-type metric into summaries. It only affects matching metrics if set_buckets was not used.