prometheus / prometheus/client_python
Registry types inconsistency
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 876
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 1
Description
Encoder generate_latest (for example) accepts registry of CollectorRegistry type but it doesn't accept registry of RestrictedRegistry type so it is not consistent. I guess RestrictedRegistry class should inherit CollectorRegistry class because instance of it can be passed to encoders (maybe not only encoders).
Another option is to inherit RestrictedRegistry class from Collector class because CollectorRegistry is inherited from this class, but then anything that accepts CollectorRegistry type should be changed to accept Collector type.
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 the generate_latest encoder entry point and compare its CollectorRegistry handling with RestrictedRegistry. Determine the intended registry type relationship and verify that the chosen design makes RestrictedRegistry acceptable anywhere a CollectorRegistry is expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100