"Historgam" fails with Python 2.7.6
See original GitHub issueHello!
I’m running prometheus_client==0.0.19
with Flask. As far as I understand the source code of the client, this registers every “Metric” in default prometheus_client.core.REGISTRY
. So in my app I do the following:
def set_monitoring(self):
self.server_summary = Histogram('main_flask_server', 'All requests timing', ['instance', 'endpoint'])
self.server_errors = Histogram('main_flask_server_errors', 'Bad requests', ['instance', 'endpoint'])
...
app. set_monitoring()
...
app.server_summary.labels('i1', key).observe(dt_ms)
...
push_to_gateway(gateway=gateway, job='flask_meme', registry=REGISTRY)
On my local machine (MacOS Sierra, Python 2.7.12) everything is fine and works perfectly. But on the Ubuntu server with Python 2.7.6 I got the exception on startup. Traceback:
unable to load app 0 (mountpoint='') (callable not found or import error)
Traceback (most recent call last):
File "/home/vladimir/membot/imager/server.py", line 104, in uwsgi_app
return get_app(conf=conf)
File "/home/vladimir/membot/imager/server.py", line 95, in get_app
flask_app.set_monitoring()
File "/home/vladimir/membot/imager/server.py", line 46, in set_monitoring
self.server_summary = Histogram('main_flask_server', 'All requests timing', ['instance', 'endpoint'])
File "/usr/local/lib/python2.7/dist-packages/prometheus_client/core.py", line 556, in init
registry.register(collector)
File "/usr/local/lib/python2.7/dist-packages/prometheus_client/core.py", line 54, in register
'in CollectorRegistry: ' + name)
ValueError: Timeseries already present in CollectorRegistry: main_flask_server_bucket
What am I doing wrong? Why Timeseries is already present in CollectorRegistry?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Cannot get histogram to show separated bins with vertical lines
I am trying to make a histogram where the bins have the 'bar style' where vertical lines separate each bin but no matter...
Read more >boost-histogram and hist - CERN Indico
▷ If anyone writes pip install boost-histogram and it fails, we have failed. • Docker ManyLinux1 GCC 8.3: /scikit-hep/manylinuxgcc. Wheels. • ...
Read more >A Vector Field Histogram implementation in Python 2.7
I'm having a hard time following your code, partly because I don't know Python but I think mostly because I'm not sure I...
Read more >Python Release Python 2.7.6
This is a 2.7 series bugfix release. Most importantly, it resolves an issue that caused the interactive prompt to crash on OS X...
Read more >hdrhistogram - PyPI
High Dynamic Range histogram in native python. ... This library provides a solution for the aggregation part of the problem: reuse the HDR...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
except those who look on github
Random github issues are not a good place for support requests, I’m locking this now.