-
Notifications
You must be signed in to change notification settings - Fork 417
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
Fix #1588 - Observable Gauge does not reflect updated values, and send the old value always #1641
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1641 +/- ##
==========================================
- Coverage 85.10% 85.08% -0.02%
==========================================
Files 159 159
Lines 4991 4990 -1
==========================================
- Hits 4247 4245 -2
- Misses 744 745 +1
|
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.
LGTM
Thanks for the fix :)
…emetry-cpp into fix-observable-instrument
@lalitb I was testing these changes. They work fine for ObservableCounter, but Observable Gauge still send the old value. Can you pls check for Observable Gauge as well |
@tauseef-ah - Thanks for testing, I felt the change should work for all the observable instruments, but let me test it for Observable Gauge too. |
@tauseef-ah - Can you test if by setting AggergationTemporality as
std::unique_ptr<metric_sdk::MetricExporter> exporter{new exportermetrics::OStreamMetricExporter(std::cout, AggregationTemporality::kDelta}; |
I guess aggregation temporality doesn't apply to Gauge since it is non-additive? |
Yes, I realized it afterward. There seems some issue in the cumulative pipeline while handling Gauge, I am looking into it. |
@tauseef-ah This has been fixed in #1651 if you want to test in the latest commit. |
…alues, and send the old value always (open-telemetry#1641)
Fixes #1588
Changes
Fixed the logic to convert monotonic increasing async counter values to the delta. Also fixed the ostream metric example to generate monotonic increasing values for the async counter.
More details -
While the observable instrument always records monotonically increasing values, it is possible for exporter/reader to request for either cumulative or delta of it. The AsyncMetricStorage::Record() method does conversion from recorded value to delta, and further passes it to TemporalMetricStorage during collection. TemporalMetricStorage further uses it to maintain the unreported values for each collector.
There was a problem in the conversion logic of recorded value -> delta in AsyncMetricStorage::Record(). This code is fixed now. And also added a test case to validate it.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes