open-telemetry / open-telemetry/opentelemetry-cpp
[Metrics SDK] Async aggregation doesn't do re-aggregation properly when the spatial dimensions are dropped
@nikhilbhatia08 is already working on this.
Since Oct 3, 2025.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.