We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e221c1 commit b7380daCopy full SHA for b7380da
opentelemetry-sdk/src/metrics/internal/histogram.rs
@@ -75,8 +75,13 @@ pub(crate) struct Histogram<T: Number> {
75
76
impl<T: Number> Histogram<T> {
77
pub(crate) fn new(mut bounds: Vec<f64>, record_min_max: bool, record_sum: bool) -> Self {
78
- bounds.retain(|v| !v.is_nan());
79
- bounds.sort_by(|a, b| a.partial_cmp(b).expect("NaNs filtered out"));
+ #[cfg(feature = "spec_unstable_metrics_views")]
+ {
80
+ // TODO: When views are used, validate this upfront
81
+ bounds.retain(|v| !v.is_nan());
82
+ bounds.sort_by(|a, b| a.partial_cmp(b).expect("NaNs filtered out"));
83
+ }
84
+
85
let buckets_count = bounds.len() + 1;
86
Histogram {
87
value_map: ValueMap::new(buckets_count),
0 commit comments