From 44d5f70c3b894a08096f2a4b75c737892acfba49 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Tue, 13 Feb 2024 11:37:42 +0000 Subject: [PATCH] Fix a small number of inconsistencies in compat package logging (#3718) This commit fixes a small number of inconsistencies in the compat package logging. It now has consistent use of classic matchers parser and UTF-8 matchers parser, instead of old matchers parser and new matchers parser. Signed-off-by: George Robinson --- matchers/compat/parse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matchers/compat/parse.go b/matchers/compat/parse.go index 7aa4e2d9..0c0dfffb 100644 --- a/matchers/compat/parse.go +++ b/matchers/compat/parse.go @@ -133,7 +133,7 @@ func FallbackMatcherParser(l log.Logger) ParseMatcher { // The input is valid in the pkg/labels parser, but not the matchers/parse // parser. This means the input is not forwards compatible. suggestion := cMatcher.String() - level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the old matchers parser as a fallback. To make this input compatible with the new parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion) + level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion) return cMatcher, nil } // If the input is valid in both parsers, but produces different results, @@ -173,7 +173,7 @@ func FallbackMatchersParser(l log.Logger) ParseMatchers { suggestion := sb.String() // The input is valid in the pkg/labels parser, but not the // new matchers/parse parser. - level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the old matchers parser as a fallback. To make this input compatible with the new parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion) + level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion) return cMatchers, nil } // If the input is valid in both parsers, but produces different results,