From 13668d3493ecdb10308b2a1aeb256cc8b79ef8bb Mon Sep 17 00:00:00 2001 From: Vladimir Smirnov Date: Wed, 20 May 2020 22:03:07 +0200 Subject: [PATCH] Proper fix for prometheus backend, non-tagged requests and groupByNodes function * fixes tests that got broken before --- CHANGES.md | 9 +++++++++ expr/helper/helper.go | 3 +++ pkg/parser/parser.go | 3 +-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9163f2715..7859ab80b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,15 @@ Changes CHANGELOG --------- +**0.13.0.rc.3** + - [Fix] Proper fix for prometheus backend and non-taged render requests with groupByNodes function + - [Fix] Align timestamps in prometheus backend (thx to @rodio, #467) + +**0.13.0-rc.2** + - [Fix] Prometheus backend wasn't working correctly for non-taged render requests (#465, thx to @menai34 for proposed fix) + - [Fix] Fix panic when using prometheus tagged response for non-tagged queries in groupByTags function (and maybe more) + - [Fix] Add proper aliases for `aggregate` functions - that would make groupByTags properly usable with functions like `diff` and `total`. + **0.13.0-rc.1** - [Improvement] Redesign error handling and logging. Logging should be now less noisy and all error messages should contain better reasoning about error cause - [Improvement] Move some of the logging messages to Debug level - that should make logs less noisy and still preserve ability to see detailed errors on Debug level diff --git a/expr/helper/helper.go b/expr/helper/helper.go index efdbaaac0..beeee4737 100644 --- a/expr/helper/helper.go +++ b/expr/helper/helper.go @@ -225,6 +225,9 @@ FOR: } switch s[i] { + // If metric name have tags, we want to skip them + case ';': + break FOR case '{': braces++ case '}': diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index fffd81ca1..64e7ef034 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -502,8 +502,7 @@ func IsNameChar(r byte) bool { r == '^' || r == '$' || r == '<' || r == '>' || r == '&' || r == '#' || - r == '/' || r == '%' || - r == ';' || r == '=' // this could happen if returned metric contains tags + r == '/' || r == '%' } func isDigit(r byte) bool {