-
Notifications
You must be signed in to change notification settings - Fork 785
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
[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
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
Offer
method signature no longer includes the "index" parameter which is not part of the spec. Instead it now acceptsstruct ExemplarMeasurement
which only exposes the value & tags (to match spec) but also tracks explicit histogram index as an internal thing.Collect
method signature no longer include "actualTags" or "reset" which are not part of the spec. The "reset" flag has becomebool ResetOnCollect
property onExemplarReservoir
. Tag filtering is now handled bystruct ReadOnlyFilteredTagCollection
which is exposed onExemplar
. Return type changed fromExemplar[]
tostruct ReadOnlyExemplarCollection
.Exemplar
FilteredTags
property is nowstruct ReadOnlyFilteredTagCollection
instead ofList<KeyValuePair<string, object?>>?
.long LongValue
in addition todouble DoubleValue
.MetricPoint
Exemplar[] GetExemplars()
is nowbool TryGetExemplars(out ReadOnlyExemplarCollection? exemplars)
.Misc improvements
ReadOnlyExemplarCollection
when enumerated only returnsExemplar
s which have been updated (Timestamp != default
). Previously each exporter had to understand the behavior and check that.Exemplar.FilteredTags
.FixedSizeExemplarReservoir
to house the shared logic bothSimpleFixedSizeExemplarReservoir
&AlignedHistogramBucketExemplarReservoir
share.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes