diff --git a/docs/querying/api.md b/docs/querying/api.md index 8b33d4cda..3069cc9ce 100644 --- a/docs/querying/api.md +++ b/docs/querying/api.md @@ -47,7 +47,7 @@ Names of query parameters that may be repeated end with `[]`. `` 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. `` placeholders refer to Prometheus duration strings of the form `[0-9]+[smhdwy]`. For example, `5m` refers to a duration of 5 minutes. diff --git a/docs/querying/basics.md b/docs/querying/basics.md index efbb73ede..062e2fe20 100644 --- a/docs/querying/basics.md +++ b/docs/querying/basics.md @@ -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 diff --git a/docs/querying/examples.md b/docs/querying/examples.md index 4e522ab85..589d6bbca 100644 --- a/docs/querying/examples.md +++ b/docs/querying/examples.md @@ -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.