You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GCCollector raises an exception in PyPy7.0/Python3.5 #378
When attempting to import prometheus_client in the PyPy 7.0 runtime with the Python 3.5 language implementation, the following exception is raised:
(prometheus-client) [zcarlson@eleusinia-forge prometheus-client]$ python
Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)
[PyPy 7.0.0 with GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import prometheus_client
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/__init__.py", line 5, in <module>
from . import gc_collector
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/gc_collector.py", line 46, in <module>
GC_COLLECTOR = GCCollector()
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/gc_collector.py", line 17, in __init__
registry.register(self)
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/registry.py", line 24, in register
names = self._get_names(collector)
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/registry.py", line 64, in _get_names
for metric in desc_func():
File "/home/zcarlson/Code/prometheus-client/env/pypy7.0-python3.5/site-packages/prometheus_client/gc_collector.py", line 37, in collect
for generation, stat in enumerate(gc.get_stats()):
TypeError: 'GcStats' object is not iterable
I believe this is because pypy has a different GC from stock CPython, and thus gc_stats() returns different information.
prometheus_client 0.5.0 seems to work, however, from initial testing...
Reacted by extraymond, Julian Berman, Lukasz Laszko and Glyph
@brian-brazil You're … right? I am not sure what versions I was testing with when I made the previous comment, but with pypy3-7.1.1 and prometheus_client==0.7.1, it now imports without emitting a traceback. Sorry for the false alarm!
Activity
brian-brazil commentedon Feb 20, 2019
Our CI should have caught that as we test on pypy, guess we also need a new test.
Krukov commentedon Feb 21, 2019
There are no CI jobs with pypy with 3,7 . Only with 2,7
https://travis-ci.org/prometheus/client_python/jobs/495991719
patallen commentedon Feb 26, 2019
Also is failing with same error on PyPy 6.0 Python 2.7.13
oberstet commentedon Feb 26, 2019
pip install "prometheus_client==0.5.0"works on PyPy 7glyph commentedon May 17, 2019
Still failing with this error on PyPy 7.1.1.
brian-brazil commentedon Aug 8, 2019
That doesn't sound right, we no longer use this code on PyPy. Can you confirm you're still seeing this?
glyph commentedon Aug 16, 2019
@brian-brazil You're … right? I am not sure what versions I was testing with when I made the previous comment, but with pypy3-7.1.1 and prometheus_client==0.7.1, it now imports without emitting a traceback. Sorry for the false alarm!
glyph commentedon Aug 16, 2019
@zcarlson-signifai Should this be closed?