python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

fix TypeError: super(type, obj): obj must be an instance or subtype issue #688

Closed jamie-liu closed 2 years ago

jamie-liu commented 6 years ago

When run diamond with ceph, collector CephStatsCollector is failed to load due to "TypeError: super(type, obj): obj must be an instance or subtype of type". According to the link, it's because the repeated calls to load_module act as a reload, the objects created using the old class no longer satisfy the isinstance test, so super will fail. So remove super from code and call parent class instead.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.04%) to 24.703% when pulling 237d637007f383887c6aaa5bc8a27ad20f4d4a6b on jamie-liu:master into f2bece462577a7c557be8a9f90f6b9340c3db571 on python-diamond:master.

shortdudey123 commented 2 years ago

Since every collector uses the same super calls, I think you have run across a bigger issue. Other collectors don't have this issue as far as I know. If you still see this, open an issue.