Fix: Observable instruments should not export stale series (#5950)#6883
Fix: Observable instruments should not export stale series (#5950)#6883rajkumar-rangaraj merged 19 commits intoopen-telemetry:mainfrom
Conversation
|
|
…metry#5950) Per the OpenTelemetry spec, MetricReader.Collect MUST only receive data points with measurements recorded since the previous collection for asynchronous instruments. The SDK was re-exporting the last known value indefinitely when an observable callback stopped reporting a series. Fixes open-telemetry#5950
e5624bf to
ddc1a41
Compare
|
Hello @cijothomas, can You have a look at this PR to fix issue #5950? I tried make the most minimal code change. But I do not know the codebase enough to determine if this is a real fix or a hack. Should the |
|
@EliaSaSe I triggered CI runs, so we'll know if this fixes the issue without other regression. Once this is done, we can ask maintainers to review the change. (I'll review as well, but will be few days before I can commit time.) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6883 +/- ##
==========================================
+ Coverage 88.51% 88.53% +0.01%
==========================================
Files 263 263
Lines 12383 12408 +25
==========================================
+ Hits 10961 10985 +24
- Misses 1422 1423 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
rajkumar-rangaraj
left a comment
There was a problem hiding this comment.
Left a minor test suggestion
|
open-telemetry/opentelemetry-specification#4861 consider adding a test for this issue. I don't know the actual recommendation from spec yet, but lets have a test and confirm and document the current behavior. |
open-telemetry/opentelemetry-rust#3334 you can steal this test case! |
|
Thanks for the feedbacks, it's appreciated. I will look into it as soon as I can, it may take a few days. |
Co-authored-by: Martin Costello <martin@martincostello.com>
…veMeasurementsOnlyTest
I will look into it in the next few days. |
Co-authored-by: Martin Costello <martin@martincostello.com>
Head branch was pushed to by a user without write access
|
@martincostello One of the builds failed, but because it was cancelled. Can the failed one be retriggered? I consider the code change as done if cjiothomas does not request further changes. |
|
Thank you all so much for your support. You made it easy to contribute. |
Aims to Fix #5950.
Changes
The https://opentelemetry.io/docs/specs/otel/metrics/sdk/#metricreader requires that for asynchronous instruments, MetricReader.Collect MUST only receive data points with measurements recorded since the previous collection. The SDK was instead re-exporting the last known value indefinitely when an observable callback stopped reporting a series.
I seems, the delta temporality path does not have this issue, because of its metric point reclaim mechanism. This PR changes the cumulative path by:
No public API changes. But I'm not sure if the behavior change is considered as API change.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes