Supported PromQL Features

When using labeled metrics, you can display a graph using the PromQL query language. The following PromQL features are supported in Mackerel.

Time series selector

  • Vector selector
    • = (equality label matcher)
    • != (inequality label matcher)
    • =~ (regular expression label matcher)
    • !~ (negative regular expression label matcher)
  • Range vector selector

Note that specifying a metric name using the __name__ label is not supported.

Constraints on range vector selectors

When the period specified in the range vector selector is significantly different from the graph display period, the graph display may be incorrect.

For example, if a 5-minute period is specified in PromQL (sum(irate(nginx_http_requests_total[5m]))), and the graph display period is 1 day, this applies.

To avoid this limitation, specify a period in the range vector selector that is as close as possible to the graph display period.


Aggregation operators

Also, the by and without modifiers for controlling the labels used for aggregation are supported.

Binary operators

Defined in 4 patterns: (vector) x (vector), (vector) x (scalar), (scalar) x (vector), and (scalar) x (scalar).

To perform vector operations, a mechanism called vector matching is implemented. One-to-one correspondence (arithmetic and comparison operators) and many-to-many correspondence (set operators) have already been implemented.

One-to-many correspondence using the group_left and group_right modifiers is not implemented.

Arithmetic operators

Comparison operators

Logical/set binary operators


Counter Caluculation Functions

<aggregation>_over_time Functions

Label Functions

Type Conversion Functions