prometheus / prometheus/client_python
Histogram without label creates histogram_*.db even without data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 876
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 1
Description
I tried this with versions: 0.19.0 and 0.20.0, both seem to have this bug.
I have a script prom_example.py:
from prometheus_client import Histogram
Example = Histogram("example", "Example", "lol")
When I run it:
prometheus_multiproc_dir=/tmp/metrics python prom_example.py
I see nothing in /tmp/metrics (as expected).
But when I edit the script and remove the label from histogram:
from prometheus_client import Histogram
Example = Histogram("example", "Example")
Database is created is /tmp/metrics, named for example: histogram_37373.db I would expect no database creation, since no data is pushed into the metric.
Edit: it seems the behaviour is the same for Counter and Gauge
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
Reproduce the issue with the prom_example.py script and prometheus_multiproc_dir using a label-free Histogram, then compare it with the labeled case. Check the initialization paths for Histogram, Counter, and Gauge; done means no .db file is created before any metric data is recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- prometheus, python
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100