Skip to content

Commit

Permalink
store: compare labels directly (thanos-io#7766)
Browse files Browse the repository at this point in the history
Do not create intermediate prometheus labels and compare the labels
directly.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
  • Loading branch information
GiedriusS authored Sep 20, 2024
1 parent 5d36a5a commit 30f453e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/store/proxy_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ func NewProxyResponseLoserTree(seriesSets ...respSet) *losertree.Tree[*storepb.S
return true
}
if a.GetSeries() != nil && b.GetSeries() != nil {
iLbls := labelpb.LabelpbLabelsToPromLabels(a.GetSeries().Labels)
jLbls := labelpb.LabelpbLabelsToPromLabels(b.GetSeries().Labels)

return labels.Compare(iLbls, jLbls) < 0
return labelpb.CompareLabels(a.GetSeries().Labels, b.GetSeries().Labels) < 0
} else if a.GetSeries() == nil && b.GetSeries() != nil {
return true
} else if a.GetSeries() != nil && b.GetSeries() == nil {
Expand Down

0 comments on commit 30f453e

Please sign in to comment.