temporality¶
This module is a mapping of the AggregationTemporality field in
CNCF OpenTelemetry trace spans. The text of the specification has
been copied into this mapping for convenience.
Where text from the CNCF OpenTelemetry specification is used it is
provided in block quotes.
From the specification:
AggregationTemporalitydefines how a metric aggregator reports aggregated values. It describes how those values relate to the time interval over which they are aggregated.
Constants¶
unspecified¶
type: I64
The default AggregationTemparality - it must not be used
conforming implementation will set the temporality to one
of the valid enumeration values.
delta¶
type: I64
DELTAis anAggregationTemporalityfor a metric aggregator which reports changes since last report time. Successive metrics contain aggregation of values from continuous and non-overlapping intervals.The values for a
DELTAmetric are based only on the time interval associated with one measurement cycle. There is no dependency on previous measurements like is the case forCUMULATIVEmetrics.For example, consider a system measuring the number of requests that it receives and reports the sum of these requests every second as a
DELTAmetric:
- The system starts receiving at time=t_0.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- The 1 second collection cycle ends. A metric is exported for the number of requests received over the interval of time t_0 to t_0+1 with a value of 3.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- The 1 second collection cycle ends. A metric is exported for the number of requests received over the interval of time t_0+1 to t_0+2 with a value of 2.
cumulative¶
type: I64
CUMULATIVEis an AggregationTemporality for a metric aggregator which reports changes since a fixed start time. This means that current values of aCUMULATIVEmetric depend on all previous measurements since the start time. Because of this, the sender is required to retain this state in some form. If this state is lost or invalidated, theCUMULATIVEmetric values MUST be reset and a new fixed start time following the last reported measurement time sent MUST be used.For example, consider a system measuring the number of requests that it receives and reports the sum of these requests every second as a
CUMULATIVEmetric:
- The system starts receiving at time=t_0.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- The 1 second collection cycle ends. A metric is exported for the number of requests received over the interval of time t_0 to t_0+1 with a value of 3.
- A request is received, the system measures 1 request.
- A request is received, the system measures 1 request.
- The 1 second collection cycle ends. A metric is exported for the number of requests received over the interval of time t_0 to t_0+2 with a value of 5.
- The system experiences a fault and loses state.
- The system recovers and resumes receiving at time=t_1.
- A request is received, the system measures 1 request.
- The 1 second collection cycle ends. A metric is exported for the number of requests received over the interval of time t_1 to t_0+1 with a value of 1.
Note: Even though, when reporting changes since last report time, using
CUMULATIVEis valid, it is not recommended. This may cause problems for systems that do not use start_time to determine when the aggregation value was reset (e.g. Prometheus).