common icon indicating copy to clipboard operation
common copied to clipboard

LabelSet.String sorts incorrectly

Open bboreham opened this issue 2 years ago • 2 comments

This code: https://github.com/prometheus/common/blob/1d8c67263f0058f5eda479684dec5751eaa1468b/model/labelset.go#L135-L138

will sort foo2="bar" before foo="bar".

The usual sort order of Prometheus labels is alphabetical by names, which would put foo before foo2.

bboreham avatar Dec 01 '23 18:12 bboreham

@bboreham , I would like to work in this issue. Can you please assign this to me?

wasim-nihal avatar Dec 12 '23 11:12 wasim-nihal

Sure, thanks for your interest. It would be good to have a small benchmark, to check that your changes run at about the same speed.

bboreham avatar Dec 12 '23 11:12 bboreham