Reference to the sample() function

Summary

sample(<numberOfTimeSeries>, <expression>)

Returns numberOfTimeSeries non-random time series based on the expression. This function is deterministic as long as the underlying set of time series stays the same. However, the returned values can change, for example, if a new source starts reporting the metric.

Parameters

ParameterDescription
numberOfTimeSeries Number of time series that you want. You can express this parameter as a number (e.g. 10) or a percentage (e.g. 17%).
expression Expression that you want to filter.

Description

Returns numberOfTimeSeries non-random time series based on the expression. This function is deterministic as long as the underlying set of time series stays the same. The returned values might change, for example, if a new source starts reporting the metric.

Don’t confuse sample() with downsample(), which returns the values in the expression that occur in each time window.

Examples

The following example shows 10% of all ~sample.cpu.loadavg.1m metrics. You would get the same results if you selected 3 of the metrics instead.

sample cpu load average

See Also

For a random set of time series, use the random() function.