Arithmetic

Absolute

FunctionDescriptionExample
abs()Graph the absolute value of the metric.abs(<METRIC_NAME>{*})

Transforms this sine timeseries sin{*}:

Sinus function

into this one abs(sin{*}):

Sinus function with abs

Logarithm

Log base 2

FunctionDescriptionExample
log2()Graph the Base-2 logarithm of the metric.log2(<METRIC_NAME>{*})

Example:

If a metric, x{*}, increments itself by 1 for each data point, then log2(x{*}) has the following shape:

 log2 function

Log base 10

FunctionDescriptionExample
log10()Graph the Base-10 logarithm of the metric.log10(<METRIC_NAME>{*})

Example:

If a metric, x{*}, increments itself by 1 for each data point, then log10(x{*}) has the following shape:

log10 function

Cumulative sum

FunctionDescriptionExample
cumsum()Graph the cumulative sum of the metric over the visible time window.cumsum(<METRIC_NAME>{*})

Example:

If a metric, const_1{*}, is a constant with the value of 1, then cumsum(const_1{*}) has the following shape:

cum sum function with abs

Cumulative sum in monitors

Cumulative sum should be avoided in monitor queries, because the cumulative sum function is a visual function. When used in a dashboard or notebook, the points will reflect values based on the selected timeframe. This doesn’t translate well in a monitor as the monitor doesn’t have a sense of which timeframe to use.

Instead, configure Cumulative Time Windows in your monitor evaluation period.

Integral

FunctionDescriptionExample
integral()Graph the integral of the metric.integral(<METRIC_NAME>{*})

Note: Datadog’s integral() is the cumulative sum of [time delta] x [value delta] over all consecutive pairs of points in the visible time window for a given metric.

integral function with abs

Other functions