You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sdk/metrics: _LastValueAggregation and OTLP encoders omit start_time_unix_nano for Gauge #5849
Per the MetricReader specification and Start timestamps specification, StartTimeUnixNano rules apply to all metrics according to the MetricReader's configured temporality for the instrument kind, "not just those whose point kinds includes an aggregation temporality field."
Currently, Gauge and ObservableGauge (LastValue aggregation) omit start_time_unix_nano:
DefaultAggregation._create_aggregation() (aggregation.py#L1176-L1188) and LastValueAggregation._create_aggregation() (aggregation.py#L1330-L1341) do not pass start_time_unix_nano to _LastValueAggregation, and _LastValueAggregation.collect() (aggregation.py#L367-L410) always sets start_time_unix_nano=None.
Hi! @dashpole I've been working on this and submitted a fix in PR #5852 (properly assigning and preserving start_time_unix_nano across _LastValueAggregation and the OTLP encoders).
Activity
ImamWahyudiz commentedon Nov 5, 2026
Hi! @dashpole I've been working on this and submitted a fix in PR #5852 (properly assigning and preserving
start_time_unix_nanoacross_LastValueAggregationand the OTLP encoders).Reviews and feedback are welcome!