-
Notifications
You must be signed in to change notification settings - Fork 598
Global error handler cleanup - exponential histogram #2235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d48133f
502885e
76a02a1
bde6dd1
4bab7f5
0a39b3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| use std::{collections::HashMap, f64::consts::LOG2_E, sync::Mutex, time::SystemTime}; | ||
|
|
||
| use once_cell::sync::Lazy; | ||
| use opentelemetry::{metrics::MetricsError, KeyValue}; | ||
| use opentelemetry::{otel_debug, KeyValue}; | ||
|
|
||
| use crate::{ | ||
| metrics::data::{self, Aggregation, Temporality}, | ||
|
|
@@ -100,9 +100,18 @@ | |
| if (self.scale - scale_delta as i8) < EXPO_MIN_SCALE { | ||
| // With a scale of -10 there is only two buckets for the whole range of f64 values. | ||
| // This can only happen if there is a max size of 1. | ||
| opentelemetry::global::handle_error(MetricsError::Other( | ||
| "exponential histogram scale underflow".into(), | ||
| )); | ||
|
|
||
| // TODO - to check if this should be logged as an error if this is auto-recoverable. | ||
| otel_debug!( | ||
| name: "ExponentialHistogramDataPoint.Scale.Underflow", | ||
| current_scale = self.scale, | ||
| scale_delta = scale_delta, | ||
| max_size = self.max_size, | ||
| min_scale = EXPO_MIN_SCALE, | ||
| value = format!("{:?}", v), | ||
| message = "The measurement will be dropped due to scale underflow. Check the histogram configuration" | ||
| ); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cijo's comment:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer to log as otel_debug till we are not sure. |
||
|
|
||
| return; | ||
| } | ||
| // Downscale | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the naming convention is
CamelCase.for log names. Is there a reason here?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no specific reasons; it simply offers clearer visibility and effectively represents hierarchy when combined with dots. For example,
ExponentialHistogramDataPoint.Scale.Underflowseems better toexponentialhistogramdatapoint.scale.underfloworexponential_histogram_datapoint.scale.underflow.Or better example to represent hierarch would be
LoggerProvider.Drop.ShutdownMutexPoisonedas compared tologgerprovider.drop.shutdownmutexpoisonedBut happy to change if there are specific guidelines/preferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TommyCpp - I am merging this to unblock. If there are specific recommendations, we can cover separately as this will affect throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get some inputs from OTel Events team recommendations. Our event name is same as what OTel Events are. (There are lot of ongoing discussions in this area, so we need to comeback to this once things are more settled)