Skip to content

Operators

Arithmetic

# addition
+

# subtraction
-

# multiplication
rate(node_network_receive_bytes_total[5m]) * 8 # convert bytes/s to bits/s
co2 * (((temp_c + 273.15) * 1013.25) / (pressure * 298.15)) # unit conversion

# division
/

# modulo
%

# power/exponentiation
^

Comparison

  • The result of the comparison operation is a filtered time series with the only matching data points
== # equal
!= # not-equal
> # greater-than
< # less-than
rate(node_network_receive_bytes_total[5m]) < 2300
rate(node_network_receive_bytes_total[5m]) < bool 2300 # returns 1 for true comparisons and 0 for false (instead of the actual value)


>= # greater-or-equal
<= # less-or-equal

Logical

# intersection
and

# union
metric1 or metric2 or metric3 # return all the time series with names metric1, metric2 and metric3

# complement
unless

Vector matching

ignoring
group_left
group_right