Skip to content

metrics: report last value for gauges under cumulative temporality#36

Open
lukashes wants to merge 1 commit into
open-telemetry:mainfrom
lukashes:fix/cumulative-gauge-last-value
Open

metrics: report last value for gauges under cumulative temporality#36
lukashes wants to merge 1 commit into
open-telemetry:mainfrom
lukashes:fix/cumulative-gauge-last-value

Conversation

@lukashes

@lukashes lukashes commented Jul 9, 2026

Copy link
Copy Markdown

Problem

The temporal aggregator always summed data points on the cumulative path, so a gauge read under cumulative temporality (e.g. via a cumulative-only exporter) accumulated its observations instead of reporting the latest one.

Solution

Gauge/ObservableGauge are the only kinds whose default aggregation is LastValue, so processCumulativeDataPoints now overwrites instead of accumulating when the instrument kind is a gauge.

Gauge/ObservableGauge are the only kinds whose default aggregation is
LastValue, so processCumulativeDataPoints now overwrites instead of
accumulating when the instrument kind is a gauge. The decision is made
from the measurements' instrument kind already available to the
function, keeping process() unaware of the reduction detail.
@lukashes lukashes requested a review from a team as a code owner July 9, 2026 06:42
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 9, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: lukashes / name: Yegor Lukash (610737c)

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.

2 participants