open-telemetry / open-telemetry/opentelemetry-cpp

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

Open
#1,724 2 comments 0 reactions 1 assignee View on GitHub

@nikhilbhatia08 is already working on this.

Since Oct 3, 2025.

bug do-not-stale
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

As discussed here - https://github.com/open-telemetry/opentelemetry-specification/issues/2905, Most of the languages doesn't handle re-aggregation when the the spatial dimensions are dropped, and C++ is no different. OpenTelemetry C++ uses the last of these processed measurements as the aggregated metrics to be reported.

So, if a view is defined for async counter to remove the attributes with "version" key. And we get the measurements.

async_counter->observer(1, {"version",1}) --> (1, {})
async_counter->observer(2, {"version",2}) --> (2, {})

Existing behavior -> Report the last measurement (2,{}) as the aggregated metrics
Expected behavior -> Report the sum of both the measurements (3, {}) as the aggregated metrics.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.