From 276c1b21d84f097eb6d2de58f46548442d654114 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 13 Feb 2021 22:45:51 +0100 Subject: [PATCH 1/6] Add a note about deprecating alertmanager in the next release. Signed-off-by: Julien Pivotto --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a105a702d..d6739f7358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ This release includes a new `--enable-feature=` flag that enables experimental features. Such features might be changed or removed in the future. +In the next minor release (2.26), Prometheus will use the Alertmanager API v2. +It will be done by defaulting `alertmanager_config.api_version` to `v2`. +Alertmanager API v2 was released in Alertmanager v0.16.0 (released in January +2019). + * [FEATURE] **experimental** API: Accept remote_write requests. Behind the --enable-feature=remote-write-receiver flag. #8424 * [FEATURE] **experimental** PromQL: Add '@ ' modifier. Behind the --enable-feature=promql-at-modifier flag. #8121 #8436 #8425 * [ENHANCEMENT] Add optional name property to testgroup for better test failure output. #8440 From 00cf59829d2b24c5a86e3606bdbd32620a86a162 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 15 Feb 2021 21:59:32 +0100 Subject: [PATCH 2/6] Recommend to get promtool from a binary distribution. Rather than compile it yourself, which doesn't work as shown anymore because of Go Modules. Signed-off-by: beorn7 --- docs/configuration/recording_rules.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/configuration/recording_rules.md b/docs/configuration/recording_rules.md index b64062c75f..ab1f5d32cb 100644 --- a/docs/configuration/recording_rules.md +++ b/docs/configuration/recording_rules.md @@ -20,14 +20,16 @@ process. The changes are only applied if all rule files are well-formatted. ## Syntax-checking rules To quickly check whether a rule file is syntactically correct without starting -a Prometheus server, install and run Prometheus's `promtool` command-line -utility tool: +a Prometheus server, you can use Prometheus's `promtool` command-line utility +tool: ```bash -go get github.com/prometheus/prometheus/cmd/promtool promtool check rules /path/to/example.rules.yml ``` +The `promtool` binary is part of the `prometheus` archive offered on the +project's [download page](https://prometheus.io/download/). + When the file is syntactically valid, the checker prints a textual representation of the parsed rules to standard output and then exits with a `0` return status. From c4536fa28c1ccf342a4436a2355b1173ba6c462e Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar Date: Tue, 16 Feb 2021 13:36:02 +0530 Subject: [PATCH 3/6] Increase block writer size for backfilling Signed-off-by: Ganesh Vernekar --- cmd/promtool/backfill.go | 8 ++++++- cmd/promtool/backfill_test.go | 45 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/cmd/promtool/backfill.go b/cmd/promtool/backfill.go index 6e7a98c555..b04fb8b557 100644 --- a/cmd/promtool/backfill.go +++ b/cmd/promtool/backfill.go @@ -93,7 +93,13 @@ func createBlocks(input []byte, mint, maxt int64, maxSamplesInAppender int, outp nextSampleTs = math.MaxInt64 err := func() error { - w, err := tsdb.NewBlockWriter(log.NewNopLogger(), outputDir, blockDuration) + // To prevent races with compaction, a block writer only allows appending samples + // that are at most half a block size older than the most recent sample appended so far. + // However, in the way we use the block writer here, compaction doesn't happen, while we + // also need to append samples throughout the whole block range. To allow that, we + // pretend that the block is twice as large here, but only really add sample in the + // original interval later. + w, err := tsdb.NewBlockWriter(log.NewNopLogger(), outputDir, 2*blockDuration) if err != nil { return errors.Wrap(err, "block writer") } diff --git a/cmd/promtool/backfill_test.go b/cmd/promtool/backfill_test.go index 56c3cf70c4..05b701a0b6 100644 --- a/cmd/promtool/backfill_test.go +++ b/cmd/promtool/backfill_test.go @@ -365,6 +365,51 @@ http_requests_total{code="400"} 1 1565166113.989 }, }, }, + { // For https://github.com/prometheus/prometheus/issues/8476. + ToParse: `# HELP http_requests_total The total number of HTTP requests. +# TYPE http_requests_total counter +http_requests_total{code="200"} 1021 0 +http_requests_total{code="200"} 1022 7199 +http_requests_total{code="400"} 1023 0 +http_requests_total{code="400"} 1024 7199 +# EOF +`, + IsOk: true, + Description: "One series spanning 2h in same block should not cause problems to other series.", + MaxSamplesInAppender: 1, + Expected: struct { + MinTime int64 + MaxTime int64 + NumBlocks int + Samples []backfillSample + }{ + MinTime: 0, + MaxTime: 7199000, + NumBlocks: 1, + Samples: []backfillSample{ + { + Timestamp: 0, + Value: 1021, + Labels: labels.FromStrings("__name__", "http_requests_total", "code", "200"), + }, + { + Timestamp: 7199000, + Value: 1022, + Labels: labels.FromStrings("__name__", "http_requests_total", "code", "200"), + }, + { + Timestamp: 0, + Value: 1023, + Labels: labels.FromStrings("__name__", "http_requests_total", "code", "400"), + }, + { + Timestamp: 7199000, + Value: 1024, + Labels: labels.FromStrings("__name__", "http_requests_total", "code", "400"), + }, + }, + }, + }, { ToParse: `no_help_no_type{foo="bar"} 42 6900 # EOF From bdf7759eeb23ae42bdef18bbf19c079eda83d24e Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 17 Feb 2021 11:49:24 +0100 Subject: [PATCH 4/6] Pin go version for windows to go1.15 Tests are failing with go 1.16 at the moment, and by default we test with latest go version. https://github.com/prometheus/prometheus/issues/8403 Signed-off-by: Julien Pivotto --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d4cfbc9507..552fa884c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: - run: # Temporary workaround until circleci updates go. command: | - choco upgrade -y golang + choco upgrade -y golang --version=1.15.8 - run: command: refreshenv From f3e7921595ab72b82081b3591953a01ec2b5b2e1 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 17 Feb 2021 12:04:12 +0100 Subject: [PATCH 5/6] Release 2.25.0 Signed-off-by: Julien Pivotto --- CHANGELOG.md | 3 ++- VERSION | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6739f7358..fb035a12cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.25.0-rc.0 / 2021-02-12 +## 2.25.0 / 2021-02-17 This release includes a new `--enable-feature=` flag that enables experimental features. Such features might be changed or removed in the future. @@ -20,6 +20,7 @@ Alertmanager API v2 was released in Alertmanager v0.16.0 (released in January * [ENHANCEMENT] TSDB: Reload blocks every minute, to detect new blocks and enforce retention more often. #8343 * [BUGFIX] API: Fix global URL when external address has no port. #8359 * [BUGFIX] Backfill: Fix error message handling. #8432 +* [BUGFIX] Backfill: Fix "add sample: out of bounds" error when series span an entire block. #8476 * [BUGFIX] Deprecate unused flag --alertmanager.timeout. #8407 * [BUGFIX] Mixins: Support remote-write metrics renamed in v2.23 in alerts. #8423 * [BUGFIX] Remote: Fix garbage collection of dropped series in remote write. #8387 diff --git a/VERSION b/VERSION index 0257f1b3f7..5c18f9195b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.25.0-rc.0 +2.25.0 From c2410d4147f003fb1d416c0e39f83fc3d05f6ab8 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 17 Feb 2021 12:49:09 +0100 Subject: [PATCH 6/6] docs: fix typo in disabled feature link Signed-off-by: Julien Pivotto --- docs/disabled_features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/disabled_features.md b/docs/disabled_features.md index 7c1c6e09e8..ec6363451b 100644 --- a/docs/disabled_features.md +++ b/docs/disabled_features.md @@ -16,7 +16,7 @@ They may be enabled by default in future versions. `--enable-feature=promql-at-modifier` The `@` modifier lets you specify the evaluation time for instant vector selectors, -range vector selectors, and subqueries. More details can be found [here](querying/basics.md#-modifier). +range vector selectors, and subqueries. More details can be found [here](querying/basics.md#modifier). ## Remote Write Receiver