We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4887e4 commit d65159bCopy full SHA for d65159b
opentelemetry-sdk/src/opentelemetry/sdk/metrics/aggregation.py
@@ -20,6 +20,7 @@
20
AGGREGATION_TEMPORALITY_CUMULATIVE,
21
AGGREGATION_TEMPORALITY_DELTA,
22
)
23
+from opentelemetry.util._time import _time_ns
24
25
26
class Aggregation(ABC):
@@ -77,8 +78,13 @@ class LastValueAggregation(Aggregation):
77
78
This aggregation collects data for the SDK sum metric point.
79
"""
80
81
+ def __init__(self):
82
+ super().__init__()
83
+ self._timestamp = _time_ns()
84
+
85
def aggregate(self, value):
86
self._value = value
87
88
89
def collect(self):
90
return self._value
0 commit comments