Skip to content

Commit 115e73f

Browse files
committed
add comment for exponential histogram
1 parent 0087c24 commit 115e73f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

opentelemetry-sdk/src/metrics/internal/exponential_histogram.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ impl<T: Number> ExpoHistogramDataPoint<T> {
100100
if (self.scale - scale_delta as i8) < EXPO_MIN_SCALE {
101101
// With a scale of -10 there is only two buckets for the whole range of f64 values.
102102
// This can only happen if there is a max size of 1.
103-
//TBD - check for throttling requirements if can happen too frequent.
103+
104+
// This error is logged when a measurement is dropped because its value is either too high
105+
// or too low, falling outside the allowable range defined by the scale and max_size.
106+
// If these values are expected, the user should adjust the histogram configuration
107+
// to accommodate the range.
104108
otel_error!(
105109
name: "ExponentialHistogramDataPoint.Scale.Underflow",
106110
current_scale = self.scale,
@@ -109,6 +113,7 @@ impl<T: Number> ExpoHistogramDataPoint<T> {
109113
min_scale = EXPO_MIN_SCALE,
110114
record_min_max = self.record_min_max,
111115
record_sum = self.record_sum,
116+
value = format!("{:?}", v),
112117
error = format!("The measurement will be dropped due to scale underflow. Check the histogram configuration")
113118
);
114119
return;

0 commit comments

Comments
 (0)