Skip to content

Cumulative ExponentialHistogram resets start time each collection #3931

Closed
@aabmass

Description

What happened?

Cumulative ExponentialHistogram points have their startTime reset each collection. E.g.

// current incorrect behavior

t0-------t1                   first collection
         t1-------t2          second collection
--------------------------> t

// instead of correct behavior

t0-------t1                    first collection
t0-----------------t2          second collection
--------------------------> t

Steps to Reproduce

#3930

Expected Result

The startTime should be the same each MetricReader collection for the same metric. The tests in linked PR draft should pass.

Actual Result

The startTime resets each collection (like a delta temporality) while the value continues to grow cumulatively. The linked PR test fails.

Additional Details

Looks like the merge function is not merging the start times: https://github.com/open-telemetry/opentelemetry-js/blob/74393ac6397dcb130b9d5dae35354a2bf9a0d2c3/packages/sdk-metrics/src/aggregator/ExponentialHistogram.ts#LL219C33-L219C33

OpenTelemetry Setup Code

No response

package.json

No response

Relevant log output

No response

Metadata

Assignees

Labels

bugSomething isn't workingpriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions