prometheus / prometheus/client_rust
Clone Family.metrics and iterate over family
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 606
- Forks
- 113
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 8
Description
Problems
-
There is no way to copy/clone the
HashMap<S,M>within family.- Use case: Storing metrics to compare against later
-
There is no way to iterate over a metric
Familyor get metrics without knowing the labels.- The only to get all metrics is to manually call
get_or_create()for every metric. This isn't great if you don't know the label names (don't store them etc...).
- The only to get all metrics is to manually call
I am happy to tackle these if you want. I think making M clone (not sure why it isn't atm) and returning a new hashmap with the cloned values would fix both these problems.
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 locating the Family implementation and its internal HashMap<S,M>, then read the surrounding API and tests. Define and implement cloning of stored metrics and iteration or retrieval without label names; done means both use cases are covered by tests and the public API remains coherent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100