Fix docs that use regexp anchors (#3504)
Remove/fix docs that use anchors in label regexp matches.
This commit is contained in:
parent
0deb74626f
commit
40f33f45cb
|
@ -47,7 +47,7 @@ Names of query parameters that may be repeated end with `[]`.
|
|||
|
||||
`<series_selector>` placeholders refer to Prometheus [time series
|
||||
selectors](basics.md#time-series-selectors) like `http_requests_total` or
|
||||
`http_requests_total{method=~"^GET|POST$"}` and need to be URL-encoded.
|
||||
`http_requests_total{method=~"(GET|POST)"}` and need to be URL-encoded.
|
||||
|
||||
`<duration>` placeholders refer to Prometheus duration strings of the form
|
||||
`[0-9]+[smhdwy]`. For example, `5m` refers to a duration of 5 minutes.
|
||||
|
|
|
@ -114,7 +114,7 @@ Label matchers can also be applied to metric names by matching against the inter
|
|||
`{__name__="http_requests_total"}`. Matchers other than `=` (`!=`, `=~`, `!~`) may also be used.
|
||||
The following expression selects all metrics that have a name starting with `job:`:
|
||||
|
||||
{__name__=~"^job:.*"}
|
||||
{__name__=~"job:.*"}
|
||||
|
||||
### Range Vector Selectors
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@ Using regular expressions, you could select time series only for jobs whose
|
|||
name match a certain pattern, in this case, all jobs that end with `server`.
|
||||
Note that this does a substring match, not a full string match:
|
||||
|
||||
http_requests_total{job=~"server$"}
|
||||
http_requests_total{job=~".*server"}
|
||||
|
||||
To select all HTTP status codes except 4xx ones, you could run:
|
||||
|
||||
http_requests_total{status!~"^4..$"}
|
||||
http_requests_total{status!~"4.."}
|
||||
|
||||
## Using functions, operators, etc.
|
||||
|
||||
|
|
Loading…
Reference in New Issue