From 00c8026a7e4b2c9b0722a5740183089343a67ce3 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 27 Jan 2016 15:59:17 +0100 Subject: [PATCH 01/13] Bump version to 0.17.0rc1 --- version/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/VERSION b/version/VERSION index 2a0970ca7..aaaf2787d 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -0.16.1 +0.17.0rc1 From 999b1d23e0bcf437ee9450de8f6b1ab6deadcf45 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Sat, 10 Oct 2015 00:49:08 +0200 Subject: [PATCH 02/13] Add tarballs target to build release tarballs. --- Makefile | 7 ++++++- scripts/release_tarballs.sh | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 scripts/release_tarballs.sh diff --git a/Makefile b/Makefile index f76a5480e..d91dc8070 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,10 @@ build: @echo ">> building binaries" @./scripts/build.sh +tarballs: + @echo ">> building release tarballs" + @./scripts/release_tarballs.sh + docker: @docker build -t prometheus:$(shell git rev-parse --short HEAD) . @@ -50,4 +54,5 @@ assets: @go-bindata $(bindata_flags) -pkg ui -o web/ui/bindata.go -ignore '(.*\.map|bootstrap\.js|bootstrap-theme\.css|bootstrap\.css)' web/ui/templates/... web/ui/static/... -.PHONY: all style format build test vet docker assets +.PHONY: all style format build test vet docker assets tarballs + diff --git a/scripts/release_tarballs.sh b/scripts/release_tarballs.sh new file mode 100755 index 000000000..464a63546 --- /dev/null +++ b/scripts/release_tarballs.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# Copyright 2015 The Prometheus Authors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +version=$(cat version/VERSION) + +for GOOS in "darwin" "freebsd" "linux" "windows"; do + for GOARCH in "amd64" "386"; do + export GOARCH + export GOOS + make build + + tarball_dir="prometheus-${version}.${GOOS}-${GOARCH}" + tarball="${tarball_dir}.tar.gz" + + if [ "$(go env GOOS)" = "windows" ]; then + ext=".exe" + fi + + echo " > $tarball" + mkdir -p "${tarball_dir}" + cp -a "prometheus${ext}" "promtool${ext}" consoles console_libraries "${tarball_dir}" + tar --owner=root --group=root -czf "${tarball}" "${tarball_dir}" + rm -rf "${tarball_dir}" + rm "prometheus${ext}" "promtool${ext}" + done +done + +exit 0 From b040827945d2c22bda62efeb970e6fc64fb26b67 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 27 Jan 2016 16:09:38 +0100 Subject: [PATCH 03/13] Add changelog for 0.17.0 --- CHANGELOG.md | 54 +++++++++++++++++++++++++++++++++++++ scripts/release_tarballs.sh | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b296894e..d7a968008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,57 @@ +## 0.17.0 / 2016-01-27 + +This version no longer works with Alertmanager version 0.4.0 and earlier! +The alerting rule syntax has changed as well but the old syntax is supported +up until version 0.18. + +* [CHANGE] Integrate with Alertmanager version 0.1.0 and higher +* [CHANGE] Degraded storage mode renamed to rushed mode +* [CHANGE] New alerting rule syntax +* [CHANGE] Add label validation on ingestion +* [CHANGE] Regular expression matchers in PromQL are anchored +* [FEATURE] Send alert resolved notifications to Alertmanager +* [FEATURE] Allow millisecond precision in configuration file +* [FEATURE] Support AirBnB's Smartstack Nerve for service discovery +* [ENHANCEMENT] Storage switches less often between regular and rushed mode. +* [ENHANCEMENT] Storage switches into rushed mode if there are too many memory chunks. +* [ENHANCEMENT] Added more storage instrumentation +* [ENHANCEMENT] Improved instrumentation of notification handler +* [BUGFIX] Do not count head chunks as chunks waiting for persistence +* [BUGFIX] Handle OPTIOPNS HTTP requests to the API correctly +* [BUGFIX] Parsing of ranges in PromQL fixed +* [BUGFIX] Correctly validate URL flag paramters + +## 0.16.2 / 2016-01-18 + +* [FEATURE] Multiple authentication options for EC2 discovery added +* [FEATURE] Several meta labels for EC2 discovery added +* [FEATURE] Allow full URLs in static target groups (used e.g. by the `blackbox_exporter`) +* [FEATURE] Add Graphite remote-storage integration +* [FEATURE] Create separate Kubernetes targets for services and their endpoints +* [FEATURE] Add `clamp_{min,max}` functions to PromQL +* [FEATURE] Omitted time parameter in API query defaults to now +* [ENHANCEMENT] Less frequent time series file truncation +* [ENHANCEMENT] Instrument number of manually deleted time series +* [ENHANCEMENT] Ignore lost+found directory during storage version detection +* [CHANGE] Kubernetes `masters` renamed to `api_servers` +* [CHANGE] "Healthy" and "unhealthy" targets are now called "up" and "down" in the web UI +* [CHANGE] Remove undocumented 2nd argument of the `delta` function. + (This is a BREAKING CHANGE for users of the undocumented 2nd argument.) +* [BUGFIX] Return proper HTTP status codes on API errors +* [BUGFIX] Fix Kubernetes authentication configuration +* [BUGFIX] Fix stripped OFFSET from in rule evaluation and display +* [BUGFIX] Do not crash on failing Consul SD initialization +* [BUGFIX] Revert changes to metric auto-completion +* [BUGFIX] Add config overflow validation for TLS configuration +* [BUGFIX] Skip already watched Zookeeper nodes in serverset SD +* [BUGFIX] Don't federate stale samples +* [BUGFIX] Move NaN to end of result for `topk/bottomk/sort/sort_desc/min/max` +* [BUGFIX] Limit extrapolation of `delta/rate/increase` +* [BUGFIX] Fix unhandled error in rule evaluation + +Some changes to the Kubernetes service discovery were integration since +it was released as a beta feature. + ## 0.16.1 / 2015-10-16 * [FEATURE] Add `irate()` function. diff --git a/scripts/release_tarballs.sh b/scripts/release_tarballs.sh index 464a63546..b4b6b68e2 100755 --- a/scripts/release_tarballs.sh +++ b/scripts/release_tarballs.sh @@ -33,7 +33,7 @@ for GOOS in "darwin" "freebsd" "linux" "windows"; do echo " > $tarball" mkdir -p "${tarball_dir}" cp -a "prometheus${ext}" "promtool${ext}" consoles console_libraries "${tarball_dir}" - tar --owner=root --group=root -czf "${tarball}" "${tarball_dir}" + tar -czf "${tarball}" "${tarball_dir}" rm -rf "${tarball_dir}" rm "prometheus${ext}" "promtool${ext}" done From 6583928a04998ce4bb95e594afcec67a9b375d27 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 27 Jan 2016 17:37:40 +0100 Subject: [PATCH 04/13] Fix typos --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a968008..ad9604397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,9 @@ up until version 0.18. * [ENHANCEMENT] Added more storage instrumentation * [ENHANCEMENT] Improved instrumentation of notification handler * [BUGFIX] Do not count head chunks as chunks waiting for persistence -* [BUGFIX] Handle OPTIOPNS HTTP requests to the API correctly +* [BUGFIX] Handle OPTIONS HTTP requests to the API correctly * [BUGFIX] Parsing of ranges in PromQL fixed -* [BUGFIX] Correctly validate URL flag paramters +* [BUGFIX] Correctly validate URL flag parameters ## 0.16.2 / 2016-01-18 From d96dc7a4db5115c8f86f0638f1f7ada030e7a26a Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 28 Jan 2016 11:16:57 +0100 Subject: [PATCH 05/13] Changelog language fixes --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9604397..d490e8d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ ## 0.17.0 / 2016-01-27 -This version no longer works with Alertmanager version 0.4.0 and earlier! +This version no longer works with Alertmanager 0.4.0 and earlier! The alerting rule syntax has changed as well but the old syntax is supported up until version 0.18. -* [CHANGE] Integrate with Alertmanager version 0.1.0 and higher +* [CHANGE] Integrate with Alertmanager 0.1.0 and higher * [CHANGE] Degraded storage mode renamed to rushed mode * [CHANGE] New alerting rule syntax * [CHANGE] Add label validation on ingestion From 667c2218162f563bc0b9e73774e7669a049c5bf4 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Fri, 5 Feb 2016 13:33:22 +0100 Subject: [PATCH 06/13] Bump version to 0.17.0rc2 --- version/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/VERSION b/version/VERSION index aaaf2787d..4de33f780 100644 --- a/version/VERSION +++ b/version/VERSION @@ -1 +1 @@ -0.17.0rc1 +0.17.0rc2 From 69ebf45649ebbefcd7f81697dd54480606f0fbee Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Sat, 20 Feb 2016 17:34:36 +0100 Subject: [PATCH 07/13] Allow custom ldflags for go build This allows users to use CGO and external linker when building Prometheus. --- scripts/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 3bf51d42f..7074ee542 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -34,7 +34,8 @@ ldflags=" -X ${repo_path}/version.Branch=${branch} -X ${repo_path}/version.BuildUser=${USER}@${host} -X ${repo_path}/version.BuildDate=${build_date} - -X ${repo_path}/version.GoVersion=${go_version}" + -X ${repo_path}/version.GoVersion=${go_version} + ${EXTRA_LDFLAGS}" export GO15VENDOREXPERIMENT="1" From 6df1f49c13aca37afca44f914c4b8f75e1b51790 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Mon, 22 Feb 2016 13:06:30 +0100 Subject: [PATCH 08/13] Remove fullLabels method and fix target updating With recent changes to a Target's internal data representation updating by fullLabels() assigns the additional default instance label. This breaks target identity comparison and causes identical targets from service discovery to be constantly swapped. --- retrieval/target.go | 12 ------------ retrieval/targetmanager.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/retrieval/target.go b/retrieval/target.go index c0d815704..0ef92bfdb 100644 --- a/retrieval/target.go +++ b/retrieval/target.go @@ -405,18 +405,6 @@ func (t *Target) InstanceIdentifier() string { return t.host() } -func (t *Target) fullLabels() model.LabelSet { - t.RLock() - defer t.RUnlock() - - lset := t.labels.Clone() - - if _, ok := lset[model.InstanceLabel]; !ok { - lset[model.InstanceLabel] = t.labels[model.AddressLabel] - } - return lset -} - // RunScraper implements Target. func (t *Target) RunScraper(sampleAppender storage.SampleAppender) { defer close(t.scraperStopped) diff --git a/retrieval/targetmanager.go b/retrieval/targetmanager.go index 55e022741..6f06438b4 100644 --- a/retrieval/targetmanager.go +++ b/retrieval/targetmanager.go @@ -278,7 +278,7 @@ func (tm *TargetManager) updateTargetGroup(tgroup *config.TargetGroup, cfg *conf // to build up. wg.Add(1) go func(t *Target) { - if err := match.Update(cfg, t.fullLabels(), t.metaLabels); err != nil { + if err := match.Update(cfg, t.labels, t.metaLabels); err != nil { log.Errorf("Error updating target %v: %v", t, err) } wg.Done() From 4d1f7b49b6d7429d88cedee612ff90f60c0f9b73 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 22 Feb 2016 15:48:39 +0100 Subject: [PATCH 09/13] Fix a race condition in calculatePersistenceUrgencyScore --- storage/local/storage.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/local/storage.go b/storage/local/storage.go index 62453d89d..b10708b20 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -18,6 +18,7 @@ import ( "container/list" "fmt" "math" + "sync" "sync/atomic" "time" @@ -124,6 +125,7 @@ type memorySeriesStorage struct { numChunksToPersist int64 // The number of chunks waiting for persistence. maxChunksToPersist int // If numChunksToPersist reaches this threshold, ingestion will be throttled. rushed bool // Whether the storage is in rushed mode. + rushedMtx sync.Mutex // Protects entering and exiting rushed mode. throttled chan struct{} // This chan is sent to whenever NeedsThrottling() returns true (for logging). fpLocker *fingerprintLocker @@ -1248,6 +1250,9 @@ func (s *memorySeriesStorage) incNumChunksToPersist(by int) { // files should not by synced anymore provided the user has specified the // adaptive sync strategy. func (s *memorySeriesStorage) calculatePersistenceUrgencyScore() float64 { + s.rushedMtx.Lock() + defer s.rushedMtx.Unlock() + var ( chunksToPersist = float64(s.getNumChunksToPersist()) maxChunksToPersist = float64(s.maxChunksToPersist) From fd5108b038c4447b02a8f54dc9cf2a13854100d3 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 22 Feb 2016 16:43:48 +0100 Subject: [PATCH 10/13] Fix a targetmanager test --- retrieval/targetmanager_test.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/retrieval/targetmanager_test.go b/retrieval/targetmanager_test.go index 0bc2a964d..2e7d95db2 100644 --- a/retrieval/targetmanager_test.go +++ b/retrieval/targetmanager_test.go @@ -315,7 +315,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job1:static:0:0": { { model.JobLabel: "test_job1", - model.InstanceLabel: "example.org:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -324,7 +323,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { }, { model.JobLabel: "test_job1", - model.InstanceLabel: "example.com:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -338,7 +336,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job1:static:0:0": { { model.JobLabel: "test_job1", - model.InstanceLabel: "example.org:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -347,7 +344,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { }, { model.JobLabel: "test_job1", - model.InstanceLabel: "example.com:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -362,7 +358,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job1:static:0:0": { { model.JobLabel: "test_job1", - model.InstanceLabel: "example.org:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -371,7 +366,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { }, { model.JobLabel: "test_job1", - model.InstanceLabel: "example.com:80", "testParam": "paramValue", model.SchemeLabel: "", model.MetricsPathLabel: "", @@ -382,7 +376,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job2:static:0:0": { { model.JobLabel: "test_job2", - model.InstanceLabel: "example.org:8080", "foo": "bar", "new": "ox-ba", model.SchemeLabel: "", @@ -391,7 +384,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { }, { model.JobLabel: "test_job2", - model.InstanceLabel: "example.com:8081", "foo": "bar", "new": "ox-ba", model.SchemeLabel: "", @@ -402,7 +394,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job2:static:0:1": { { model.JobLabel: "test_job2", - model.InstanceLabel: "foo.com:1234", model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1234", @@ -427,7 +418,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job2:static:0:0": { { model.JobLabel: "test_job2", - model.InstanceLabel: "example.org:8080", "foo": "bar", "new": "ox-ba", model.SchemeLabel: "", @@ -435,7 +425,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { model.AddressLabel: "example.org:8080"}, { model.JobLabel: "test_job2", - model.InstanceLabel: "example.com:8081", "foo": "bar", "new": "ox-ba", model.SchemeLabel: "", @@ -446,7 +435,6 @@ func TestTargetManagerConfigUpdate(t *testing.T) { "test_job2:static:0:1": { { model.JobLabel: "test_job2", - model.InstanceLabel: "foo.com:1234", model.SchemeLabel: "", model.MetricsPathLabel: "", model.AddressLabel: "foo.com:1234", @@ -494,7 +482,7 @@ func TestTargetManagerConfigUpdate(t *testing.T) { for _, expt := range expTargets { found := false for _, actt := range actTargets { - if reflect.DeepEqual(expt, actt.fullLabels()) { + if reflect.DeepEqual(expt, actt.labels) { found = true break } From 0c537d6af6b8a4a4d957c2a354812a7303618758 Mon Sep 17 00:00:00 2001 From: Ignacio Carbajo Date: Mon, 22 Feb 2016 23:25:17 +0000 Subject: [PATCH 11/13] Fix minor typo --- util/testutil/directory.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/testutil/directory.go b/util/testutil/directory.go index c9d8def28..1672c5b01 100644 --- a/util/testutil/directory.go +++ b/util/testutil/directory.go @@ -31,7 +31,7 @@ const ( type ( // Closer is the interface that wraps the Close method. Closer interface { - // Close reaps the underlying directory and its children. The directory + // Close reaps the underlying directory and its children. The directory // could be deleted by its users already. Close() } @@ -59,7 +59,7 @@ type ( } // T implements the needed methods of testing.TB so that we do not need - // to actually import testing (which has the side affect of adding all + // to actually import testing (which has the side effect of adding all // the test flags, which we do not want in non-test binaries even if // they make use of these utilities for some reason). T interface { From b7e6651e06726354ff843aacc15caffe69c00063 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt Date: Mon, 22 Feb 2016 19:48:31 -0500 Subject: [PATCH 12/13] Improve 0.17.0 changelog * remove wrong release date until 0.17.0 gets actually released * fix wrong alertmanager version number * add example for regex anchor change --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d490e8d8f..fa6a5a95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ -## 0.17.0 / 2016-01-27 +## 0.17.0 / unreleased -This version no longer works with Alertmanager 0.4.0 and earlier! +This version no longer works with Alertmanager 0.0.4 and earlier! The alerting rule syntax has changed as well but the old syntax is supported up until version 0.18. +All regular expressions in PromQL are anchored now, matching the behavior of +regular expressions in config files. Expressions in rules, alerts or dashboards +need to be changed if they don't match the full value so far (for example +`http_requests_total{status=~"^5"}` won't match anything anymore and needs to +be changed to `http_requests_total{status=~"5.."}`). + * [CHANGE] Integrate with Alertmanager 0.1.0 and higher * [CHANGE] Degraded storage mode renamed to rushed mode * [CHANGE] New alerting rule syntax From 8fa1560e489eaa39eec31f2f930a49b9d443c230 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 23 Feb 2016 15:30:56 +0100 Subject: [PATCH 13/13] Fix a very special case of handling the checkpoint timer --- storage/local/storage.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/local/storage.go b/storage/local/storage.go index b10708b20..55f81bd36 100644 --- a/storage/local/storage.go +++ b/storage/local/storage.go @@ -966,6 +966,13 @@ loop: } else { dirtySeriesCount = 0 } + // If a checkpoint takes longer than checkpointInterval, unluckily timed + // combination with the Reset(0) call below can lead to a case where a + // time is lurking in C leading to repeated checkpointing without break. + select { + case <-checkpointTimer.C: // Get rid of the lurking time. + default: + } checkpointTimer.Reset(s.checkpointInterval) case fp := <-memoryFingerprints: if s.maintainMemorySeries(fp, model.Now().Add(-s.dropAfter)) {