Skip to content

Commit 0d28327

Browse files
Improve the warning message to include escaping (prometheus#4156)
Signed-off-by: George Robinson <[email protected]>
1 parent ec9a21e commit 0d28327

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

matcher/compat/parse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func FallbackMatcherParser(l *slog.Logger) ParseMatcher {
133133
// The input is valid in the pkg/labels parser, but not the matcher/parse
134134
// parser. This means the input is not forwards compatible.
135135
suggestion := cMatcher.String()
136-
l.Warn("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)
136+
l.Warn("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 and backslashes are escaped. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
137137
return cMatcher, nil
138138
}
139139
// If the input is valid in both parsers, but produces different results,
@@ -173,7 +173,7 @@ func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
173173
suggestion := sb.String()
174174
// The input is valid in the pkg/labels parser, but not the
175175
// new matcher/parse parser.
176-
l.Warn("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)
176+
l.Warn("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 and backslashes are escaped. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
177177
return cMatchers, nil
178178
}
179179
// If the input is valid in both parsers, but produces different results,

0 commit comments

Comments
 (0)