prometheus / prometheus/client_js
Reimplement 'labels' as a derivative of the Metric instead of a closure
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.5k
- Forks
- 429
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 22
Description
With the existence of LabelMap, there are simpler mechanisms available to give multiple callers a set of labels to apply to all metrics calls.
Problem areas:
- copy constructor
- reset - I already have a TODO in the code about how reset is poorly implemented, and this will need to be fixed.
- metrics gathering - a derived metric has already had its stats reported and should return empty set
In the bargain however, this one feature addresses #777, #407, and #598 all without introducing performance regressions.
Additional Concerns
Based on conversation in #813, it would be useful for consistency with the other client implementations if, when all of the labels have been captured (full coverage versus #407's currying suggestion) that the derived gauge be initialized to 0 if it is not already in the store.
Contributor guide
No contributing guide indexed for this repository
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
No files or tests are named. Start by locating the labels implementation and LabelMap, then trace its copy constructor, reset behavior, and metrics-gathering path. Done means labels use a derived Metric without performance regressions, already-reported derived metrics return an empty set, and fully labeled gauges initialize to 0 when absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- observability-sre
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100