diff --git a/.circleci/config.yml b/.circleci/config.yml index d4cfbc950..552fa884c 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a105a702..fb035a12c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ -## 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. +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 @@ -15,6 +20,7 @@ experimental features. Such features might be changed or removed in the future. * [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 0257f1b3f..5c18f9195 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.25.0-rc.0 +2.25.0 diff --git a/cmd/promtool/backfill.go b/cmd/promtool/backfill.go index 6e7a98c55..b04fb8b55 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 56c3cf70c..05b701a0b 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 diff --git a/docs/disabled_features.md b/docs/disabled_features.md index 7c1c6e09e..ec6363451 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