diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/aggregation.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/aggregation.py index 1a592db1a84..5882f8f730c 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/aggregation.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/aggregation.py @@ -20,6 +20,7 @@ AGGREGATION_TEMPORALITY_CUMULATIVE, AGGREGATION_TEMPORALITY_DELTA, ) +from opentelemetry.util._time import _time_ns class Aggregation(ABC): @@ -79,6 +80,7 @@ class LastValueAggregation(Aggregation): def aggregate(self, value): self._value = value + self._timestamp = _time_ns() def collect(self): return self._value