Repository navigation
fix(metrics): retain delta baseline across missed collection in PrecomputedSum - #3720
darkraider01 wants to merge 1 commit into
Conversation
…mputedSum PrecomputedSum::delta previously replaced its reported map with only attribute sets observed during the current collection cycle. If an observable counter missed a collection or observed a non-finite value, its baseline was lost and the subsequent delta was computed from zero (open-telemetry#3714). Track a consecutive missed count per attribute set to retain the baseline through exactly one missed collection cycle, and evict after two consecutive missed cycles to keep memory bounded. Filter non-finite measurements upfront in Measure::call.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3720 +/- ##
=======================================
- Coverage 83.2% 83.1% -0.1%
=======================================
Files 131 130 -1
Lines 29598 29415 -183
=======================================
- Hits 24630 24455 -175
+ Misses 4968 4960 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cijothomas
left a comment
There was a problem hiding this comment.
I’d prefer to wait for clarification in [specification(https://github.com/open-telemetry/opentelemetry-specification/issues/4861) before changing this behavior. The proposed one-cycle retention policy is not currently defined by the specification and its better to get a spec blessing to ensure consistency.
|
Alright ! I'll fold it into draft PR until then |
Pull request dashboard statusWaiting on the author · refreshed 2026-10-26 20:04 UTC Move out of draft to request review. Status above doesn't look right?
|
|
Thank you for your contribution! This PR has been automatically marked as stale because it has not had activity in the last 14 days. This may be due to a delay in review on our side or awaiting a response from you; either is fine, and we appreciate your patience. It will be closed in 14 days if no further activity occurs. Pushing a new commit or leaving a comment will remove the stale label and keep the PR open. |
Fixes #3714
Changes
PrecomputedSum::reportedwithBaselineEntry<T>trackinglast_valueand consecutivemissed_count.missed_countat the start of each collection cycle.missed_countto 0 whenever an attribute set has an accepted observation.NaNand infinite values upfront inMeasure::callandBoundPrecomputedSumHandle::call, preventing invalid measurements from being recorded and treating those cycles as missed collections.observable_counter_delta_attribute_set_reappears_after_gapto expect delta30(80 - 50) on reappearance after 1 missed cycle.delta_rejects_nan_and_retains_baselineforf64NaN rejection and baseline preservation.delta_evicts_baseline_after_two_consecutive_missed_collections.observable_counter_delta_stale_evictionandobservable_counter_delta_f64_nan_rejection.opentelemetry-sdk/CHANGELOG.mdunder## vNext.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes