From 731b59a41f24ae014f86d01dd23957ad5a35b355 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 6 Dec 2022 15:02:35 +0100 Subject: More precise histograms --- src/metrics.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/metrics.rs b/src/metrics.rs index c635269..46b69af 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -21,7 +21,16 @@ pub struct MetricsServer { impl MetricsServer { pub fn init(bind_addr: Option) -> MetricsServer { - let exporter = opentelemetry_prometheus::exporter().init(); + let exporter = opentelemetry_prometheus::exporter() + .with_default_summary_quantiles(vec![0.25, 0.5, 0.75, 0.9, 0.95, 0.99]) + .with_default_histogram_boundaries(vec![ + 0.001, 0.0015, 0.002, 0.003, 0.005, 0.007, + 0.01, 0.015, 0.02, 0.03, 0.05, 0.07, + 0.1, 0.15, 0.2, 0.3, 0.5, 0.7, + 1., 1.5, 2., 3., 5., 7., + 10., 15., 20., 30., 40., 50., 60., 70., 100. + ]) + .init(); Self { bind_addr, exporter, -- cgit v1.2.3