📈 Sum represents a scalar metric calculated as a sum of all reported measurements.

Sums are perfect for counters and cumulative values. They can be monotonic (only increasing) or non-monotonic (can increase or decrease).

const requestsSum: Sum = {
dataPoints: [
{
attributes: [
{ key: "method", value: { stringValue: "GET" } },
{ key: "status", value: { stringValue: "200" } }
],
startTimeUnixNano: "1640995200000000000",
timeUnixNano: "1640995260000000000",
asInt: 1542,
exemplars: [],
flags: 0
}
],
aggregationTemporality: AggregationTemporality.CUMULATIVE,
isMonotonic: true
};
interface Sum {
    aggregationTemporality: AggregationTemporality;
    dataPoints: NumberDataPoint[];
    isMonotonic: boolean;
}

Properties

aggregationTemporality: AggregationTemporality

How the aggregation is performed over time

dataPoints: NumberDataPoint[]

Array of data points for this sum

isMonotonic: boolean

Whether this sum only increases (true for counters)