Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UTF-8 label matchers: Add metrics to matchers compat package #3658

Merged
merged 7 commits into from
Jan 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bug where disagreement returned wrong matchers
This commit fixes a bug where an input that caused disagreement
would return the result of matchers/parse and not pkg/labels.
This is to prevent disagreement breaking configurations such as
routes should unexpected disagreement occur (i.e. disagreement
that is not due to added support for UTF-8).

Signed-off-by: George Robinson <[email protected]>
grobinson-grafana committed Jan 4, 2024
commit 852cb76e334d05d9edf6b4ecac97f1db1dd4a58f
2 changes: 2 additions & 0 deletions matchers/compat/parse.go
Original file line number Diff line number Diff line change
@@ -178,6 +178,7 @@ func FallbackMatcherParser(l log.Logger, m *Metrics) ParseMatcher {
if nErr == nil && cErr == nil && !reflect.DeepEqual(nMatcher, cMatcher) {
m.DisagreeTotal.With(lbs).Inc()
level.Warn(l).Log("msg", "Matchers input has disagreement", "input", input)
return cMatcher, nil
}
return nMatcher, nil
}
@@ -227,6 +228,7 @@ func FallbackMatchersParser(l log.Logger, m *Metrics) ParseMatchers {
if nErr == nil && cErr == nil && !reflect.DeepEqual(nMatchers, labels.Matchers(cMatchers)) {
m.DisagreeTotal.With(lbs).Inc()
level.Warn(l).Log("msg", "Matchers input has disagreement", "input", input)
return cMatchers, nil
}
return nMatchers, nil
}