Skip to content
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

ObservableGauge collect data points since previous collection #2618

Merged

Conversation

fraillt
Copy link
Contributor

@fraillt fraillt commented Feb 5, 2025

Fixes #2213

Changes

Some explanation for implementation:

  1. observable/asynchronous instruments ALWAYS report data points since previous collection
  2. Temporality affects how measurements are aggregated AND when data points are reported
  3. LastValue aggregation always use last measured value, no matter what temporality
  • Hence: always use Delta temporality for observable gauge (which uses last value aggregation), in order to report data points from previous collection.

I think there are more issues with other observable instruments, but these will require more sophisticated solution to solve...
We probably need to utilize different value map implementations to make things efficient for all metrics, so #2530 will become essential to further improvements/fixes.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@fraillt fraillt requested a review from a team as a code owner February 5, 2025 19:21
@fraillt fraillt force-pushed the observable-gauge-collect-if-changed branch from c4e6a43 to 46475c0 Compare February 5, 2025 19:50
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.1%. Comparing base (ad38303) to head (ef66b1b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/pipeline.rs 75.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2618   +/-   ##
=====================================
  Coverage   79.0%   79.1%           
=====================================
  Files        119     119           
  Lines      22534   22555   +21     
=====================================
+ Hits       17822   17842   +20     
- Misses      4712    4713    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

Maybe a changelog for letting users know the issue is fixed for ObservableGauge and still open for other Observables.

@cijothomas cijothomas merged commit d79950d into open-telemetry:main Feb 5, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ObservableGauge no longer dropping data points from old Attributes values
2 participants