prometheus / prometheus/client_rust

Expensive metric validation in debug mode

Open
#52 10 comments 0 reactions 0 assignees View on GitHub

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 _total as that is added automatically already.
  • Registry::register could ensure that no duplicate metric names are being registered.
  • Registry::register could ensure that the user did not provide an additional . in the HELP text. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.