Skip to content

[Metrics SDK] Fix spatial re-aggregation for asynchronous instruments - #4635

Open
nikhilbhatia08 wants to merge 4 commits into
open-telemetry:mainfrom
nikhilbhatia08:1724-reaggregation-fix-for-dimensions-dropping
Open

nikhilbhatia08 wants to merge 4 commits into
open-telemetry:mainfrom
nikhilbhatia08:1724-reaggregation-fix-for-dimensions-dropping

Conversation

@nikhilbhatia08

Copy link
Copy Markdown
Contributor

Fixes #1724

Changes

Fix spatial re-aggregation for asynchronous instruments. A view which drops attributes is now applied to asynchronous instruments as well, and the observations which collapse onto the same attribute set are re-aggregated (summed up for the additive instruments) instead of the last observation overwriting the previous ones. Note that AsyncMetricStorage's constructor now takes the view's AttributesProcessor, matching SyncMetricStorage.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@nikhilbhatia08
nikhilbhatia08 requested a review from a team as a code owner September 23, 2026 20:14
@nikhilbhatia08 nikhilbhatia08 changed the title Fix spatial re-aggregation for asynchronous instruments [Metrics SDK] Fix spatial re-aggregation for asynchronous instruments Sep 23, 2026
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.53%. Comparing base (ad74ba2) to head (7f6100f).

Files with missing lines Patch % Lines
...telemetry/sdk/metrics/state/async_metric_storage.h 96.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4635      +/-   ##
==========================================
+ Coverage   86.53%   86.53%   +0.01%     
==========================================
  Files         525      525              
  Lines       20475    20498      +23     
==========================================
+ Hits        17715    17735      +20     
- Misses       2760     2763       +3     
Files with missing lines Coverage Δ
sdk/src/metrics/meter.cc 81.36% <100.00%> (ø)
...telemetry/sdk/metrics/state/async_metric_storage.h 93.75% <96.30%> (+0.57%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

[Metrics SDK] Async aggregation doesn't do re-aggregation properly when the spatial dimensions are dropped

1 participant