open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.66k stars 568 forks source link

Fix exponential histogram aggregation #3977

Open ocelotl opened 1 week ago

ocelotl commented 1 week ago

Describe your environment

OS: (e.g, Ubuntu) Python version: (e.g., Python 3.8.10) SDK version: (e.g., 1.25.0) API version: (e.g., 1.25.0)

What happened?

The aggregation of the exponential histogram with CUMULATIVE collection aggregation temporality is wrong.

Steps to Reproduce

Run this

Expected Result

Same start time for all points with CUMULATIVE collection aggregation temporality.

Actual Result

Different start time for all points with CUMULATIVE collection aggregation temporality.

Additional context

No response

Would you like to implement a fix?

None

Charlie-lizhihan commented 1 week ago

I would like to ask if this issue is related to or could potentially solve issue #3974. Both seem to deal with the StartTimeUnixNano property in the context of ExponentialHistogram metrics.

ocelotl commented 1 week ago

It is very likely they are related, the exponential histogram aggregation needs a complete refactoring similar to #3429