Make regex-matching docs more obvious

Split out the note about regex-matching into a separate paragraph to
make it more obvious. Move it up, closer to the definition.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
SuperQ 2022-01-10 16:44:24 +01:00
parent a5d57c9269
commit a3dd323a53
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1

View file

@ -104,14 +104,15 @@ against regular expressions. The following label matching operators exist:
* `=~`: Select labels that regex-match the provided string.
* `!~`: Select labels that do not regex-match the provided string.
Regex matches are fully anchored. A match of `env=~"foo"` is treated as `env=~"^foo$"`.
For example, this selects all `http_requests_total` time series for `staging`,
`testing`, and `development` environments and HTTP methods other than `GET`.
http_requests_total{environment=~"staging|testing|development",method!="GET"}
Label matchers that match empty label values also select all time series that
do not have the specific label set at all. Regex-matches are fully anchored. It
is possible to have multiple matchers for the same label name.
do not have the specific label set at all. It is possible to have multiple matchers for the same label name.
Vector selectors must either specify a name or at least one label matcher
that does not match the empty string. The following expression is illegal: