Reference to the all() function


all(<timeWindow>, <tsExpression>)

Returns 1 if the expression has been non-zero at every point in time during the time window. Otherwise, returns 0.


timeWindow Amount of time in the moving time window. You can specify a time measurement based on the clock or calendar (1s, 1m, 1h, 1d, 1w), the window length (1vw) of the chart, or the bucket size (1bw) of the chart. Default is minutes if the unit is not specified.
tsExpression Expression that describes the condition to be tested for.


The all() function enables you to emulate an alert window and helps you predetermine how often an alert would fire based on existing data within a shifting time window.

The all() function looks at the displayed point buckets within a specified moving time window and:

  • Returns 1 if all of the displayed point buckets meets the specified condition.
  • Returns 0 in all other cases.

Note: You can use any() to test whether one or more displayed point buckets meet the condition.


The following example shows the value 1 if the two sources in the query have the same number of failure requests (shown in orange), and shows 0 otherwise. The two time series are shown in the background.

all example