Skip to content

Commit c55370d

Browse files
committed
add warning too
1 parent d27b2f0 commit c55370d

File tree

1 file changed

+8
-0
lines changed
  • opentelemetry/src/metrics/instruments

1 file changed

+8
-0
lines changed

opentelemetry/src/metrics/instruments/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ impl<'a, T> HistogramBuilder<'a, T> {
9999
///
100100
/// If invalid boundaries are provided, the instrument will not report
101101
/// measurements.
102+
/// Providing an empty `vec![]` means no bucket information will be
103+
/// calculated.
104+
///
105+
/// # Warning
106+
/// Using more buckets can improve the accuracy of percentile calculations in backends.
107+
/// However, this comes at a cost, including increased memory, CPU, and network usage.
108+
/// Choose the number of buckets carefully, considering your application's performance
109+
/// and resource requirements.
102110
pub fn with_boundaries(mut self, boundaries: Vec<f64>) -> Self {
103111
self.boundaries = Some(boundaries);
104112
self

0 commit comments

Comments
 (0)