Skip to content

LabelSet.String sorts incorrectly #543

@bboreham

Description

@bboreham

This code:

common/model/labelset.go

Lines 135 to 138 in 1d8c672

lstrs = append(lstrs, fmt.Sprintf("%s=%q", l, v))
}
sort.Strings(lstrs)

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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions