[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.
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.
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.
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.)
|
@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.UpdateWithExemplarmethods (double&long):Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes