prometheus / prometheus/client_python
Bug in remove function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 876
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 1
Description
The remove function failed if the label aren't order in the alphabetical order.
If they aren't, we have a KeyError.
For exemple that failed :
observ_thresholds = Gauge('thresholds', 'Seuil', ['host', 'domaine'])
observ_thresholds.labels('myserveur','prod').set(5)
observ_thresholds.remove('myserveur','prod')
For exemple that is good :
observ_thresholds = Gauge('thresholds', 'Seuil', ['host', 'perimeter'])
observ_thresholds.labels('myserveur','prod').set(5)
observ_thresholds.remove('myserveur','prod')
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 locating the remove function in the Python client and reproduce the failure with the Gauge example using label names in different orders. Verify that removing the labeled value succeeds without a KeyError and that the reported labels are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100