-
Notifications
You must be signed in to change notification settings - Fork 512
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
Upgrade to latest mimir-prometheus #6312
Conversation
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
44486a7
to
5738f95
Compare
if a.Name != b.Name { | ||
return a.Name < b.Name | ||
slices.SortFunc(keys, func(a, b labels.Label) int { | ||
nameCompare := strings.Compare(a.Name, b.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to open an upstream PR to not use strings.Compare()
here. This should be something like:
if a.Name == b.Name {
// ... compare using < > here ...
}
@@ -412,7 +413,7 @@ func yoloBytes(s string) (b []byte) { | |||
// New returns a sorted Labels from the given labels. | |||
// The caller has to guarantee that all label names are unique. | |||
func New(ls ...Label) Labels { | |||
slices.SortFunc(ls, func(a, b Label) bool { return a.Name < b.Name }) | |||
slices.SortFunc(ls, func(a, b Label) int { return strings.Compare(a.Name, b.Name) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to consider replacing strings.Compare()
in this file too, and run a benchmark to see the actual perf impact.
Comments on vendored Prometheus are not blockers to merge, but please consider it. |
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
cc @charleskorn |
What this PR does
Upgrade to latest mimir-prometheus, see PR for its latest sync with upstream. I'm not aware of any behavioral changes that'll affect Mimir.
Please note that I'm replacing github.com/charleskorn/goautoneg with a Grafana Labs fork github.com/grafana/goautoneg, based off of the same commit. I needed to make a fix to goautoneg so it would compile with the new revision of golang.org/x/exp. I think it's better going forward to use a Grafana Labs fork rather than a personal one?
Which issue(s) this PR fixes or relates to
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]