prometheus / prometheus/client_python

Add support for passing in label kwargs to remove() function

Open
#820 1 comment 0 reactions 0 assignees View on GitHub

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.