mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Format PromQL section, replace table
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
This commit is contained in:
parent
962a3cd6be
commit
b2fd5b7e45
|
@ -54,17 +54,13 @@ This document offers guidance on migrating from Prometheus 2.x to Prometheus 3.0
|
|||
|
||||
- The `.` pattern in regular expressions in PromQL matches newline characters.
|
||||
With this change a regular expressions like `.*` matches strings that include
|
||||
`\n`. This applies to matchers in queries and relabel configs. For example the
|
||||
following regular expressions now match the accompanying strings, whereas in
|
||||
Prometheus v2 these combinations didn't match.
|
||||
|
||||
| Regex | Additional matches |
|
||||
| ----- | ------ |
|
||||
| ".*" | "foo\n", "Foo\nBar" |
|
||||
| "foo.?bar" | "foo\nbar" |
|
||||
| "foo.+bar" | "foo\nbar" |
|
||||
|
||||
If you want Prometheus v3 to behave like v2 did, you will have to change your
|
||||
`\n`. This applies to matchers in queries and relabel configs.
|
||||
- For example, the following regular expressions now match the accompanying
|
||||
strings, whereas in Prometheus v2 these combinations didn't match.
|
||||
- `.*` additionally matches `foo\n` and `Foo\nBar`
|
||||
- `foo.?bar` additionally matches `foo\nbar`
|
||||
- `foo.+bar` additionally matches `foo\nbar`
|
||||
- If you want Prometheus v3 to behave like v2, you will have to change your
|
||||
regular expressions by replacing all `.` patterns with `[^\n]`, e.g.
|
||||
`foo[^\n]*`.
|
||||
- Lookback and range selectors are left open and right closed (previously left
|
||||
|
|
Loading…
Reference in a new issue