prometheus / prometheus/client_rust
Expensive metric validation in debug mode
Open
Nobody has claimed this yet.
good first issue
help wanted
- Dominant language
- Rust
- Stars
- 606
- Forks
- 113
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 8
Description
When run in debug mode, I think it is worth exploring running different validations on the registered metrics.
Examples:
- We could make sure a counter name does not end in
_totalas that is added automatically already. -
Registry::registercould ensure that no duplicate metric names are being registered. -
Registry::registercould ensure that the user did not provide an additional.in theHELPtext. See https://github.com/prometheus/client_rust/issues/56
I think a goal worth striving for is keeping the dependency tree small for the sake of compile times.
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 reading Registry::register and the metric encoding logic in src/encoding/text.rs, especially the linked counter-name handling. Define which validations belong in debug mode, including duplicate names, counter suffixes, and HELP text, then establish tests and a dependency-size constraint before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100