Skip to content

Commit da619fe

Browse files
committed
add doc
1 parent b4c5e70 commit da619fe

File tree

2 files changed

+14
-3
lines changed
  • opentelemetry-sdk/src/metrics
  • opentelemetry/src/metrics/instruments

2 files changed

+14
-3
lines changed

opentelemetry-sdk/src/metrics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ mod tests {
197197
histogram.record(1.9, &[]);
198198
test_context.flush_metrics();
199199

200-
// As bucket boundaires via Advisory params are invalid, no metrics
201-
// should be exported
200+
// As bucket boundaires provided via advisory params are invalid, no
201+
// metrics should be exported
202202
test_context.check_no_metrics();
203203
}
204204
}

opentelemetry/src/metrics/instruments/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,18 @@ impl<'a, T> HistogramBuilder<'a, T> {
8787
///
8888
/// Setting boundaries is optional. By default, the boundaries are set to:
8989
///
90-
/// `[0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0]`
90+
/// `[0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0,
91+
/// 2500.0, 5000.0, 7500.0, 10000.0]`
92+
///
93+
/// # Notes
94+
/// - Boundaries must not contain `f64::NAN`, `f64::INFINITY` or
95+
/// `f64::NEG_INFINITY`
96+
/// - Values must be in strictly increasing order (e.g., each value must be
97+
/// greater than the previous).
98+
/// - Boundaries must not contain duplicate values.
99+
///
100+
/// If invalid boundaries are provided, the instrument will not report
101+
/// measurements.
91102
pub fn with_boundaries(mut self, boundaries: Vec<f64>) -> Self {
92103
self.boundaries = Some(boundaries);
93104
self

0 commit comments

Comments
 (0)