delta_monotonic

Description

Calculates the amount of difference in a column in each time bin for each group.

delta_monotonic by default assumes the argument to be monotonically increasing, and treats decreasing values as counter resets. See also delta.

When the argument is a metric defined using set_metric, delta_monotonic behaves differently according to the specified metric type:

  • for gauge and cumulativeCounter metrics, delta_monotonic retains the default behavior of assuming monotonic increases.

  • for delta metrics, delta_monotonic will sum up the values in the time window to return the total sum. Negatives may be produced for negative input values.

Return type

numeric or duration

Domain

This is an aggregate function (aggregates rows over a group in aggregate verbs.)

This is a window function (calculates over a group of multiple input rows using windowing.)

Categories

Usage

delta_monotonic(val)

Argument

Type

Optional

Repeatable

Restrictions

val

numeric or duration

no

no

none

Examples

align 5m, requests: delta_monotonic(m("requests_total"))

Computes the delta_monotonic of “requests_total” metric for each 5m time bins. The result will be non-negative.