-
Notifications
You must be signed in to change notification settings - Fork 854
[sdk-metrics] Exemplar spec improvements #5386
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] Exemplar spec improvements #5386
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5386 +/- ##
==========================================
- Coverage 83.38% 83.25% -0.14%
==========================================
Files 297 284 -13
Lines 12531 12049 -482
==========================================
- Hits 10449 10031 -418
+ Misses 2082 2018 -64
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/MetricItemExtensions.cs
Show resolved
Hide resolved
src/OpenTelemetry/Metrics/Exemplar/AlignedHistogramBucketExemplarReservoir.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry/Metrics/Exemplar/FixedSizeExemplarReservoir.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry/Metrics/Exemplar/SimpleFixedSizeExemplarReservoir.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry/Metrics/Exemplar/ReadOnlyExemplarCollection.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/MetricItemExtensions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/MetricItemExtensions.cs
Show resolved
Hide resolved
src/OpenTelemetry/Metrics/Exemplar/FixedSizeExemplarReservoir.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/MetricItemExtensions.cs
Show resolved
Hide resolved
cijothomas
left a comment
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.
Thanks a lot!
left couple of minor comments, lets address it as follow ups
[Split out from #5364]
Changes
ExemplarReservoir
Offermethod signature no longer includes the "index" parameter which is not part of the spec. Instead it now acceptsstruct ExemplarMeasurementwhich only exposes the value & tags (to match spec) but also tracks explicit histogram index as an internal thing.Collectmethod signature no longer include "actualTags" or "reset" which are not part of the spec. The "reset" flag has becomebool ResetOnCollectproperty onExemplarReservoir. Tag filtering is now handled bystruct ReadOnlyFilteredTagCollectionwhich is exposed onExemplar. Return type changed fromExemplar[]tostruct ReadOnlyExemplarCollection.Exemplar
FilteredTagsproperty is nowstruct ReadOnlyFilteredTagCollectioninstead ofList<KeyValuePair<string, object?>>?.long LongValuein addition todouble DoubleValue.MetricPoint
Exemplar[] GetExemplars()is nowbool TryGetExemplars(out ReadOnlyExemplarCollection? exemplars).Misc improvements
ReadOnlyExemplarCollectionwhen enumerated only returnsExemplars which have been updated (Timestamp != default). Previously each exporter had to understand the behavior and check that.Exemplar.FilteredTags.FixedSizeExemplarReservoirto house the shared logic bothSimpleFixedSizeExemplarReservoir&AlignedHistogramBucketExemplarReservoirshare.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes