prometheus / prometheus/prometheus

storage/remote: Add type and unit label support directly in ts.ToLabels()

Open
#17,340 1 comment 0 reactions 0 assignees View on GitHub

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 AddToLabels but honestly the better solution would be to add type and unit (optional) support (using AddToLabels) inside the writev2 codec utils e.g ts.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

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.