selector
Selectors allow selecting and filtering of a set of time series.
#
Simple SelectorIn the simplest form you need to specify only a metric name.
#
SyntaxThe metric name pattern syntax is simple pattern.
#
ExamplesThis example selects all time series that have the go_memstats_alloc_bytes
metric name:
This example selects all time series with metric names starts with go_memstats_
:
This example selects all time series with metric names starts with go_
except go_memstats_
:
#
Advanced SelectorIt is possible to filter these time series further by appending a comma separated list of label matchers in curly braces ({}
).
#
SyntaxThe metric name pattern syntax is simple pattern.
Label matching operators:
=
: Match labels that are exactly equal to the provided string.!=
: Match labels that are not equal to the provided string.=~
: Match labels that regex-match the provided string.!~
: Match labels that do not regex-match the provided string.=*
: Match labels that simple-pattern-match the provided string.!*
: Match labels that do not simple-pattern-match the provided string.
#
ExamplesThis example selects all time series that:
- have the
node_cooling_device_cur_state
metric name and - label
type
value not equal toFan
:
This example selects all time series that:
- have the
node_filesystem_size_bytes
metric name and - label
device
value is either/dev/nvme0n1p1
or/dev/nvme0n1p2
and - label
fstype
is equal toext4
Label matchers can also be applied to metric names by matching against the internal __name__
label.
For example, the expression node_filesystem_size_bytes
is equivalent to {__name__="node_filesystem_size_bytes"}
.
This allows using all operators (other than =*
) for metric names matching.
The following expression selects all metrics that have a name starting with node_
: