From ad8138a65d3fcbf860e48b03edbf38ed4c066a03 Mon Sep 17 00:00:00 2001 From: Fiona Liao Date: Mon, 11 Nov 2024 16:36:58 +0000 Subject: [PATCH 1/4] Add newlines before code blocks Signed-off-by: Fiona Liao --- docs/migration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/migration.md b/docs/migration.md index 8a78ee63ab..c3d16472b7 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -143,6 +143,7 @@ scrape_configs: ### Log message format Prometheus v3 has adopted `log/slog` over the previous `go-kit/log`. This results in a change of log message format. An example of the old log format is: + ``` ts=2024-10-23T22:01:06.074Z caller=main.go:627 level=info msg="No time or size retention was set so using the default time retention" duration=15d ts=2024-10-23T22:01:06.074Z caller=main.go:671 level=info msg="Starting Prometheus Server" mode=server version="(version=, branch=, revision=91d80252c3e528728b0f88d254dd720f6be07cb8-modified)" @@ -151,6 +152,7 @@ ts=2024-10-23T22:01:06.074Z caller=main.go:677 level=info host_details="(Linux 5 ``` a similar sequence in the new log format looks like this: + ``` time=2024-10-24T00:03:07.542+02:00 level=INFO source=/home/user/go/src/github.com/prometheus/prometheus/cmd/prometheus/main.go:640 msg="No time or size retention was set so using the default time retention" duration=15d time=2024-10-24T00:03:07.542+02:00 level=INFO source=/home/user/go/src/github.com/prometheus/prometheus/cmd/prometheus/main.go:681 msg="Starting Prometheus Server" mode=server version="(version=, branch=, revision=7c7116fea8343795cae6da42960cacd0207a2af8)" From 962a3cd6bec885a96de5efe65ea2cfca53b54f80 Mon Sep 17 00:00:00 2001 From: Fiona Liao Date: Mon, 11 Nov 2024 16:39:46 +0000 Subject: [PATCH 2/4] Add backticks to fallback_scrape_protocol Signed-off-by: Fiona Liao --- docs/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration.md b/docs/migration.md index c3d16472b7..f01555675f 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -95,7 +95,7 @@ header was unparsable or unrecognised. This could lead to incorrect data being parsed in the scrape. Prometheus v3 will now fail the scrape in such cases. If a scrape target is not providing the correct Content-Type header the -fallback protocol can be specified using the fallback_scrape_protocol +fallback protocol can be specified using the `fallback_scrape_protocol` parameter. See [Prometheus scrape_config documentation.](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config) This is a breaking change as scrapes that may have succeeded with Prometheus v2 From b2fd5b7e45df6264b535fcdcb5fe7ee9ad094022 Mon Sep 17 00:00:00 2001 From: Fiona Liao Date: Mon, 11 Nov 2024 16:45:13 +0000 Subject: [PATCH 3/4] Format PromQL section, replace table Signed-off-by: Fiona Liao --- docs/migration.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/migration.md b/docs/migration.md index f01555675f..4d40a54814 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -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 @@ -73,11 +69,11 @@ This document offers guidance on migrating from Prometheus 2.x to Prometheus 3.0 timeseries with evenly spaced samples exactly 1 minute apart. Before Prometheus v3, a range query with `5m` would usually return 5 samples. But if the query evaluation aligns perfectly with a scrape, it would return 6 samples. In - Prometheus v3 queries like this will always return 5 samples. + Prometheus v3 queries like this will always return 5 samples. This change has likely few effects for everyday use, except for some subquery - use cases. + use cases. Query front-ends that align queries usually align subqueries to multiples of - the step size. These subqueries will likely be affected. + the step size. These subqueries will likely be affected. Tests are more likely to affected. To fix those either adjust the expected number of samples or extend the range by less than one sample interval. - The `holt_winters` function has been renamed to `double_exponential_smoothing` From 67764d7cfd3b192865285c3f6b11944829cc00ba Mon Sep 17 00:00:00 2001 From: Fiona Liao Date: Mon, 11 Nov 2024 17:39:33 +0000 Subject: [PATCH 4/4] Better spacing for flags Signed-off-by: Fiona Liao --- docs/migration.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/migration.md b/docs/migration.md index 4d40a54814..f98e7d0cb1 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -18,19 +18,19 @@ This document offers guidance on migrating from Prometheus 2.x to Prometheus 3.0 - `remote-write-receiver` - `new-service-discovery-manager` - `expand-external-labels` - Environment variable references `${var}` or `$var` in external label values + - Environment variable references `${var}` or `$var` in external label values are replaced according to the values of the current environment variables. - References to undefined variables are replaced by the empty string. + - References to undefined variables are replaced by the empty string. The `$` character can be escaped by using `$$`. - `no-default-scrape-port` - Prometheus v3 will no longer add ports to scrape targets according to the + - Prometheus v3 will no longer add ports to scrape targets according to the specified scheme. Target will now appear in labels as configured. - If you rely on scrape targets like - `https://example.com/metrics` or `http://exmaple.com/metrics` to be - represented as `https://example.com/metrics:443` and - `http://example.com/metrics:80` respectively, add them to your target URLs + - If you rely on scrape targets like + `https://example.com/metrics` or `http://exmaple.com/metrics` to be + represented as `https://example.com/metrics:443` and + `http://example.com/metrics:80` respectively, add them to your target URLs - `agent` - Instead use the dedicated `--agent` CLI flag. + - Instead use the dedicated `--agent` CLI flag. Prometheus v3 will log a warning if you continue to pass these to `--enable-feature`.