Arithmetic operators
Arithmetic operators perform numeric operations on instant vectors or scalars: addition (+), subtraction (-), multiplication (*), division (/), modulo (%), and power (^).

Example — convert bytes to kibibytes (KiB).
node_memory_active_bytes reports memory in bytes; divide by 1024 to convert to KiB:
Arithmetic on a metric produces a computed vector — the result does not preserve the original metric name. The result contains the same labels but no original metric identifier. This is expected PromQL behavior.
Dividing by
1000 converts to decimal kilobytes (kB); dividing by 1024 converts to kibibytes (KiB). Choose based on the unit system you want.Comparison operators
Comparison operators filter or compare metric values:==, !=, >, <, >=, <=.

Example — filter network flags greater than
100:
The bool modifier
The bool modifier changes a comparison from a filter (dropping non-matching series) into a 0/1 indicator for each input series. This is especially useful for alerting rules where you need an on/off numeric signal rather than a filtered set.
Example — check which filesystems have less than 1000 bytes available:
1 indicates the comparison evaluated to true; 0 indicates false. Use these boolean vectors directly in alert expressions or downstream calculations.
Operator precedence
PromQL evaluates expressions according to operator precedence. Higher-precedence operators are evaluated before lower-precedence ones. Operators on the same precedence level are left-associative (evaluated left-to-right), except exponentiation (^) which is right-associative.

2 * 3 % 2is evaluated as(2 * 3) % 2(left-to-right).2 ^ 3 ^ 2is evaluated as2 ^ (3 ^ 2)(right-to-left).
Logical operators: or, and, unless
PromQL provides three set-level logical operators that operate on series sets:or, and, and unless.

Examples
- Return filesystems with available bytes greater than
1000and less than3000(intersection):
- Union: filesystems with available bytes less than
500or greater than70000:
unless(left set difference): return series greater than1000unless they are greater than30000:
Putting it together: quick interactive examples
Combine arithmetic, comparison, and logical operators to build targeted queries. Example — add 50 tonode_arp_entries:
6_000_000 bytes:
1_000_000_000 bytes):
or example — values less than 6_000_000 OR greater than 10_000_000_000:
Summary
- Arithmetic operators (
+,-,*,/,%,^) perform numeric transformations and unit conversions. - Comparison operators (
==,!=,>,<,>=,<=) filter series; useboolto emit 0/1 results for alerting. - Operator precedence determines evaluation order; use parentheses to make expressions explicit.
- Logical set operators (
and,or,unless) combine or subtract series sets to build complex queries.
- Prometheus PromQL documentation: https://prometheus.io/docs/prometheus/latest/querying/basics/
- PromQL operators and expressions: https://prometheus.io/docs/prometheus/latest/querying/operators/