Skip to content

Commit

Permalink
Histogram buckets only used for specific features
Browse files Browse the repository at this point in the history
  • Loading branch information
emschwartz committed Mar 21, 2023
1 parent d99cabe commit 1e8dbdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions autometrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub use self::prometheus_exporter::*;

/// We use the histogram buckets recommended by the OpenTelemetry specification
/// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation
#[cfg(any(feature = "prometheus", feature = "prometheus-exporter"))]
pub(crate) const HISTOGRAM_BUCKETS: [f64; 14] = [
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,
];
Expand Down
3 changes: 1 addition & 2 deletions autometrics/src/tracker/prometheus.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::labels::{CounterLabels, GaugeLabels, HistogramLabels};
use crate::HISTOGRAM_BUCKETS;
use crate::{constants::*, tracker::TrackMetrics};
use crate::{constants::*, tracker::TrackMetrics, HISTOGRAM_BUCKETS};
use const_format::{formatcp, str_replace};
use once_cell::sync::Lazy;
use prometheus::histogram_opts;
Expand Down

0 comments on commit 1e8dbdb

Please sign in to comment.