-
Notifications
You must be signed in to change notification settings - Fork 450
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
Add with_boundaries
hint API for explicit bucket histograms
#2135
Add with_boundaries
hint API for explicit bucket histograms
#2135
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2135 +/- ##
=====================================
Coverage 78.9% 79.0%
=====================================
Files 121 121
Lines 20831 20908 +77
=====================================
+ Hits 16453 16527 +74
- Misses 4378 4381 +3 ☔ View full report in Codecov by Sentry. |
@@ -72,6 +76,12 @@ impl<'a, T> HistogramBuilder<'a, T> { | |||
self.unit = Some(unit.into()); | |||
self | |||
} | |||
|
|||
/// Set the boundaries for this histogram. |
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.
// Setting boundaries is optional. By default, the boundaries are set to
// [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]
please copy this wording too.
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.
LGTM!
This was probably the last blocker, and now we can upgrade opentelemetry metrics api as beta.
Co-incidentally, OTel .NET just did the same feature addition at same time as OTel Rust! |
Related to #1241
Changes
with_boundaries
hint API for explicit bucket histogramsUsage
let histogram = meter .f64_histogram("my_histogram") .with_description("My histogram example description") + .with_boundaries(vec![1.0, 2.0, 3.0, 4.0, 5.0]) .init();
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes