prometheus / prometheus/prometheus
storage/remote: Add type and unit label support directly in ts.ToLabels()
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 66.1k
- Forks
- 10.8k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 131
Description
Follow up of #17329
it's better now with
AddToLabelsbut honestly the better solution would be to add type and unit (optional) support (usingAddToLabels) inside thewritev2codec utils e.gts.ToLabels(&b, req.Symbols, h.typeAndUnitLabels)We could add TODO for this and add later, but otherwise this might be a bit expensive to use. WDYT?
Originally posted by @bwplotka in https://github.com/prometheus/prometheus/pull/17329#discussion_r2432792767
Proposal
Extend the `ToLabels()` method signature to optionally include metadata (type and unit) as labels during the initial label construction, avoiding redundant passes over the data.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the writev2 codec utilities and the existing ToLabels() and AddToLabels() paths, then read the context in issue #17329. The change is complete when ToLabels() can optionally include type and unit metadata during initial label construction and avoids redundant passes over the data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100