prometheus / prometheus/client_rust
Provide a way to set a `Counter` to an absolute value
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 606
- Forks
- 113
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 8
Description
I'm writing a reexporter for another service that already outputs aggregated metrics (but not in a Prometheus compatible format). It would be very convenient to be able to directly call .set(existing_value) on a Prometheus counter, instead of having to track the previous value manually and inc_by a computed amount.
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
The issue names no files or tests. Start by locating the Rust Counter API and reviewing the existing inc_by behavior, then read the 12-comment discussion for constraints around setting an absolute value. Done means an agreed API and semantics for set(existing_value), with coverage demonstrating the intended counter behavior.
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
- Mostly clear
- Newbie friendliness
- 38/100