-
Notifications
You must be signed in to change notification settings - Fork 773
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
[sdk-metrics] Support exemplars when using exponential histograms #5396
[sdk-metrics] Support exemplars when using exponential histograms #5396
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5396 +/- ##
==========================================
+ Coverage 83.38% 84.27% +0.88%
==========================================
Files 297 284 -13
Lines 12531 12080 -451
==========================================
- Hits 10449 10180 -269
+ Misses 2082 1900 -182
Flags with carried forward coverage won't be shown. Click here to find out more.
|
.SetExemplarFilter(new AlwaysOnExemplarFilter()) | ||
.AddView(i => | ||
{ | ||
if (i.Name.StartsWith("testGauge")) |
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.
i am not able to see the need for custom sized (3) for this instrument, and not others? Are we validating them separately?
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.
Good catch. I removed the view from this test. Probably got there copy/pasting 🤣 Observables are an interesting case for exemplars. We only observe them during collect so there will only ever be at most 1 exemplar exported regardless of reservoir size. If user is doing TraceBasedExemplarFilter
then they likely will never see an exemplar for observables because they are collected outside of all traces unless you go and force a trace in the observe callback which feels very strange. Might need to do something about that in SDK/spec?
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.
yes. I want to see if spec would change the defaults, so that exemplars are opt-in. specifically, users must opt-in to exemplars for each instrument. (The key reasoning being - most users just need exemplar for one key instrument, typically the one measuring latency. The current model enables Exemplars for every instrument, including Observables as well, leading to wasted cpu/memory etc.)
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
@CodeBlanch Do you want to update the OTLP Exporter as well to export exemplars for Exponential Histograms? |
Going to be my next PR! |
Changes
Adds support for exemplars when using exponential histograms.
Improves test coverage for the permutations of the
MetricPoint.UpdateWithExemplar
methods (double
&long
):Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes