common icon indicating copy to clipboard operation
common copied to clipboard

LabelSet.String sorts incorrectly

Open bboreham opened this issue 8 months 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