TypeError in floatToGoString in utils.py
When one PureStorage array controller is failed it reports None value for metric purefa_network_interface_performance. The function floatToGoString fails because it cannot handle None value.
I added two lines in my local copy of "utils.py" to make this function work, so it replaces None value with 0 (zero).
Instead of:
def floatToGoString(d):
d = float(d)
I use:
def floatToGoString(d):
if d is None:
d = 0
d = float(d)
Below is the error message:
File "/home/pure_exporter/venv/lib/python3.7/site-packages/prometheus_client/utils.py", line 9, in floatToGoString d = float(d) TypeError: ("float() argument must be a string or a number, not 'NoneType'", Metric(purefa_network_interface_performance, FlashArray network interface performance, gauge, , [Sample(name='purefa_network_interface_performance', labels={'interface': 'ct0.eth5', 'dimension': 'rx_bytes'}, value=None, timestamp=None, exemplar=None),
That may work for your case, but I am not sure it is behavior we want in the library. Do you know how a value of None was set in that metric? That seems like a bug in the collector, or maybe elsewhere in this library. If anything I would expect None to translate to NaN not 0.