prometheus / prometheus/common

LabelSet.String sorts incorrectly

Open
#543 2 comments 0 reactions 1 assignee View on GitHub

@wasim-nihal is already working on this.

Since Dec 12, 2023.

Dominant language
Go
Stars
295
Forks
367
Avg merge
2d 10h
Merged PRs (30d)
18

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.