From 22a04239c937be61df95fdb60f0661684693cf3b Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Fri, 31 Jan 2020 14:38:56 -0800 Subject: [PATCH 1/7] cut V2.16.0 rc.0 against the right branch (#6736) * Cut v2.16.0-rc.0 pre release Signed-off-by: Callum Styan --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 667aa413e..aec59dcc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +## 2.16.0-rc.0 / 2020-01-30 + +* [FEATURE] React UI: Support local timezone on /graph #6692 +* [FEATURE] PromQL: add absent_over_time query function #6490 +* [FEATURE] Adding optional logging of queries to their own file #6520 +* [ENHANCEMENT] React UI: Add support for rules page and "Xs ago" duration displays #6503 +* [ENHANCEMENT] React UI: alerts page, replace filtering togglers tabs with checkboxes #6543 +* [ENHANCEMENT] TSDB: Export metric for WAL write errors #6647 +* [ENHANCEMENT] TSDB: Improve query performance for queries that only touch the most recent 2h of data. #6651 +* [ENHANCEMENT] PromQL: Refactoring in parser errors to improve error messages #6634 +* [ENHANCEMENT] PromQL: Support trailing commas in grouping opts #6480 +* [ENHANCEMENT] Scrape: Reduce memory usage on reloads by reusing scrape cache #6670 +* [ENHANCEMENT] Scrape: Add metrics to track bytes and entries in the metadata cache #6675 +* [ENHANCEMENT] promtool: Add support for line-column numbers for invalid rules output #6533 +* [ENHANCEMENT] Avoid restarting rule groups when it is unnecessary #6450 +* [BUGFIX] React UI: Send cookies on fetch() on older browsers #6553 +* [BUGFIX] React UI: adopt grafana flot fix for stacked graphs #6603 +* [BUFGIX] React UI: broken graph page browser history so that back button works as expected #6659 +* [BUGFIX] TSDB: ensure compactionsSkipped metric is registered, and log proper error if one is returned from head.Init #6616 +* [BUGFIX] TSDB: return an error on ingesting series with duplicate labels #6664 +* [BUGFIX] PromQL: Fix unary operator precedence #6579 +* [BUGFIX] PromQL: Respect query.timeout even when we reach query.max-concurrency #6712 +* [BUGFIX] PromQL: Fix string and parentheses handling in engine, which affected React UI #6612 +* [BUGFIX] PromQL: Remove output labels returned by absent() if they are produced by multiple identical label matchers #6493 +* [BUGFIX] Scrape: Validate that OpenMetrics input ends with `# EOF` #6505 +* [BUGFIX] Remote read: return the correct error if configs can't be marshal'd to JSON #6622 +* [BUGFIX] Remote write: Make remote client `Store` use passed context, which can affect shutdown timing #6673 +* [BUGFIX] Remote write: Improve sharding calculation in cases where we would always be consistently behind by tracking pendingSamples #6511 +* [BUGFIX] Ensure prometheus_rule_group metrics are deleted when a rule group is removed #6693 + ## 2.15.2 / 2020-01-06 * [BUGFIX] TSDB: Fixed support for TSDB blocks built with Prometheus before 2.1.0. #6564 diff --git a/VERSION b/VERSION index 07d875c2d..e04308974 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.15.2 +2.16.0-rc.0 From 40b66d29ffa8a5db1e2fb47721249cb60a4b85e6 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Fri, 7 Feb 2020 08:33:26 +0100 Subject: [PATCH 2/7] OpenMetrics parse: avoid setting prev token (#6781) We can avoid setting a prev token in the OM parser. The previous coundition that checked for prev was unreacheable. Signed-off-by: Julien Pivotto --- pkg/textparse/openmetricsparse.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/textparse/openmetricsparse.go b/pkg/textparse/openmetricsparse.go index 647223a3b..35ef1d5c4 100644 --- a/pkg/textparse/openmetricsparse.go +++ b/pkg/textparse/openmetricsparse.go @@ -90,7 +90,6 @@ type OpenMetricsParser struct { hasTS bool start int offsets []int - prev token eOffsets []int exemplar []byte @@ -233,19 +232,14 @@ func (p *OpenMetricsParser) Next() (Entry, error) { p.exemplarVal = 0 p.hasExemplarTs = false - t := p.nextToken() - defer func() { p.prev = t }() - switch t { + switch t := p.nextToken(); t { case tEofWord: if t := p.nextToken(); t != tEOF { return EntryInvalid, errors.New("unexpected data after # EOF") } return EntryInvalid, io.EOF case tEOF: - if p.prev != tEofWord { - return EntryInvalid, errors.New("data does not end with # EOF") - } - return EntryInvalid, io.EOF + return EntryInvalid, errors.New("data does not end with # EOF") case tHelp, tType, tUnit: switch t := p.nextToken(); t { case tMName: From 881dde505ac732bed6044dadc86efabcb737d2ad Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 8 Feb 2020 16:26:26 +0100 Subject: [PATCH 3/7] promql: fix promql query log step unit Signed-off-by: Julien Pivotto --- cmd/prometheus/query_log_test.go | 12 +++++++++--- promql/engine.go | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/prometheus/query_log_test.go b/cmd/prometheus/query_log_test.go index 2dd1bac68..503982bf2 100644 --- a/cmd/prometheus/query_log_test.go +++ b/cmd/prometheus/query_log_test.go @@ -105,7 +105,7 @@ func (p *queryLogTest) query(t *testing.T) { switch p.origin { case apiOrigin: r, err := http.Get(fmt.Sprintf( - "http://%s:%d%s/api/v1/query?query=%s", + "http://%s:%d%s/api/v1/query_range?step=5&start=0&end=3600&query=%s", p.host, p.port, p.prefix, @@ -148,7 +148,13 @@ func (p *queryLogTest) queryString() string { func (p *queryLogTest) validateLastQuery(t *testing.T, ql []queryLogLine) { q := ql[len(ql)-1] testutil.Equals(t, p.queryString(), q.Params.Query) - testutil.Equals(t, 0, q.Params.Step) + + switch p.origin { + case apiOrigin: + testutil.Equals(t, 5, q.Params.Step) + default: + testutil.Equals(t, 0, q.Params.Step) + } if p.origin != ruleOrigin { host := p.host @@ -160,7 +166,7 @@ func (p *queryLogTest) validateLastQuery(t *testing.T, ql []queryLogLine) { switch p.origin { case apiOrigin: - testutil.Equals(t, p.prefix+"/api/v1/query", q.Request.Path) + testutil.Equals(t, p.prefix+"/api/v1/query_range", q.Request.Path) case consoleOrigin: testutil.Equals(t, p.prefix+"/consoles/test.html", q.Request.Path) case ruleOrigin: diff --git a/promql/engine.go b/promql/engine.go index 0add9e147..87914c30f 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -437,7 +437,8 @@ func (ng *Engine) exec(ctx context.Context, q *query) (v Value, w storage.Warnin if eq, ok := q.Statement().(*EvalStmt); ok { params["start"] = formatDate(eq.Start) params["end"] = formatDate(eq.End) - params["step"] = eq.Interval + // The step provided by the user is in seconds. + params["step"] = durationMilliseconds(eq.Interval) / 1000 } f := []interface{}{"params", params} if err != nil { From cbd0eec9fc130b5ee1c19a7a73dca8df8bf14792 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 8 Feb 2020 16:30:00 +0100 Subject: [PATCH 4/7] Avoid /1000 Signed-off-by: Julien Pivotto --- promql/engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promql/engine.go b/promql/engine.go index 87914c30f..a3321fc87 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -438,7 +438,7 @@ func (ng *Engine) exec(ctx context.Context, q *query) (v Value, w storage.Warnin params["start"] = formatDate(eq.Start) params["end"] = formatDate(eq.End) // The step provided by the user is in seconds. - params["step"] = durationMilliseconds(eq.Interval) / 1000 + params["step"] = int64(eq.Interval / (time.Second / time.Nanosecond)) } f := []interface{}{"params", params} if err != nil { From d799078c883b869b739efcee965503f99ebadc05 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 8 Feb 2020 16:42:33 +0100 Subject: [PATCH 5/7] also test start and end Signed-off-by: Julien Pivotto --- cmd/prometheus/query_log_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/prometheus/query_log_test.go b/cmd/prometheus/query_log_test.go index 503982bf2..b0d551b8f 100644 --- a/cmd/prometheus/query_log_test.go +++ b/cmd/prometheus/query_log_test.go @@ -152,6 +152,8 @@ func (p *queryLogTest) validateLastQuery(t *testing.T, ql []queryLogLine) { switch p.origin { case apiOrigin: testutil.Equals(t, 5, q.Params.Step) + testutil.Equals(t, "1970-01-01T00:00:00.000Z", q.Params.Start) + testutil.Equals(t, "1970-01-01T01:00:00.000Z", q.Params.End) default: testutil.Equals(t, 0, q.Params.Step) } @@ -362,6 +364,8 @@ type queryLogLine struct { Params struct { Query string `json:"query"` Step int `json:"step"` + Start string `json:"start"` + End string `json:"end"` } `json:"params"` Request struct { Path string `json:"path"` From f94faafbda8bb5937f51ac6c901daab4ec52c275 Mon Sep 17 00:00:00 2001 From: Bartlomiej Plotka Date: Mon, 10 Feb 2020 12:47:58 +0000 Subject: [PATCH 6/7] Cutting v2.16.0-rc.1 Signed-off-by: Bartlomiej Plotka --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aec59dcc2..eabbff7e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.16.0-rc.0 / 2020-01-30 +## 2.16.0-rc.1 / 2020-02-10 * [FEATURE] React UI: Support local timezone on /graph #6692 * [FEATURE] PromQL: add absent_over_time query function #6490 diff --git a/VERSION b/VERSION index e04308974..fe29787ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.16.0-rc.0 +2.16.0-rc.1 From b90be6f32a33c03163d700e1452b54454ddce0ec Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Thu, 13 Feb 2020 15:33:53 -0800 Subject: [PATCH 7/7] Release 2.16.0 (#6817) Signed-off-by: Callum Styan --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eabbff7e0..2f8745c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.16.0-rc.1 / 2020-02-10 +## 2.16.0 / 2020-02-13 * [FEATURE] React UI: Support local timezone on /graph #6692 * [FEATURE] PromQL: add absent_over_time query function #6490 diff --git a/VERSION b/VERSION index fe29787ed..752490696 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.16.0-rc.1 +2.16.0