|
1 | 1 | use std::{collections::HashMap, f64::consts::LOG2_E, sync::Mutex, time::SystemTime}; |
2 | 2 |
|
3 | 3 | use once_cell::sync::Lazy; |
4 | | -use opentelemetry::{metrics::MetricsError, KeyValue}; |
| 4 | +use opentelemetry::{otel_debug, KeyValue}; |
5 | 5 |
|
6 | 6 | use crate::{ |
7 | 7 | metrics::data::{self, Aggregation, Temporality}, |
@@ -100,9 +100,20 @@ impl<T: Number> ExpoHistogramDataPoint<T> { |
100 | 100 | if (self.scale - scale_delta as i8) < EXPO_MIN_SCALE { |
101 | 101 | // With a scale of -10 there is only two buckets for the whole range of f64 values. |
102 | 102 | // This can only happen if there is a max size of 1. |
103 | | - opentelemetry::global::handle_error(MetricsError::Other( |
104 | | - "exponential histogram scale underflow".into(), |
105 | | - )); |
| 103 | + |
| 104 | + // TODO - to check if this should be logged as an error if this is auto-recoverable. |
| 105 | + otel_debug!( |
| 106 | + name: "ExponentialHistogramDataPoint.Scale.Underflow", |
| 107 | + current_scale = self.scale, |
| 108 | + scale_delta = scale_delta, |
| 109 | + max_size = self.max_size, |
| 110 | + min_scale = EXPO_MIN_SCALE, |
| 111 | + record_min_max = self.record_min_max, |
| 112 | + record_sum = self.record_sum, |
| 113 | + value = format!("{:?}", v), |
| 114 | + error = "The measurement will be dropped due to scale underflow. Check the histogram configuration" |
| 115 | + ); |
| 116 | + |
106 | 117 | return; |
107 | 118 | } |
108 | 119 | // Downscale |
|
0 commit comments