Skip to content

Commit 1e8dbdb

Browse files
committed
Histogram buckets only used for specific features
1 parent d99cabe commit 1e8dbdb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

autometrics/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub use self::prometheus_exporter::*;
2121

2222
/// We use the histogram buckets recommended by the OpenTelemetry specification
2323
/// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation
24+
#[cfg(any(feature = "prometheus", feature = "prometheus-exporter"))]
2425
pub(crate) const HISTOGRAM_BUCKETS: [f64; 14] = [
2526
0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0,
2627
];

autometrics/src/tracker/prometheus.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::labels::{CounterLabels, GaugeLabels, HistogramLabels};
2-
use crate::HISTOGRAM_BUCKETS;
3-
use crate::{constants::*, tracker::TrackMetrics};
2+
use crate::{constants::*, tracker::TrackMetrics, HISTOGRAM_BUCKETS};
43
use const_format::{formatcp, str_replace};
54
use once_cell::sync::Lazy;
65
use prometheus::histogram_opts;

0 commit comments

Comments
 (0)