prometheus / prometheus/client_python
Add support for passing in label kwargs to remove() function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 876
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 1
Description
Hello,
Would it be possible/would it get maintainer support to add the ability to pass in kwargs to the remove() function:
https://github.com/prometheus/client_python/blob/5a5261dd45d65914b5e3d8225b94d6e0578882f3/prometheus_client/metrics.py#L200
I think it should be pretty simple to do, I think the logic would remain largely the same as the above labels() function from an implementation perspective, but rather than setting a value it just calls del on it.
Thanks!
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 at prometheus_client/metrics.py around the referenced remove() function and compare it with the labels() function. Add support for removing by label kwargs while preserving existing behavior, then run the relevant project tests and confirm both removal forms behave correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100