Reference to the sqrt() function

Summary

sqrt(<expression>)

Returns the square root of each data value described by the expression.

Parameters

ParameterDescription
expression Expression describing the values to find the square root of.

Description

The sqrt() function produces data points by taking the square root of the data points returned by the input expression.

  • If expression is a constant, then sqrt() returns the square root of that constant.
  • If expression describes one or more time series, then sqrt() returns a new time series for each input time series. Each value in a new time series is obtained by taking the square root of the value of the corresponding point in the input time series.

Examples

In this example, your chart shows the values in the metric ~sample.process.num for a single source.

ts sqrt before

And here we see the result of applying the sqrt function to the expression.

ts sqrt after

Here we see what happens when the input expression returns data points for 2 sources, app-14 and db-8. Notice that sqrt returns two time series, one for each series returned by the expression.

ts sqrt multiple sources