Open DrewBloechl opened 6 years ago
Would you like to send a PR?
At a glance it looks simple enough to fix (famous last words). I'll give it a shot within the next couple of days.
Did you have a chance to work on this?
This hit me yesterday and the workaround isn't pretty.
I was looking at how to fix it, and the easiest solution (and potentially slowest , but given suboptimal string operations around, not that bad), is to use str(v).replace(...
.
The only other way I see is do this during adding the labels, but this isn't restricted in any way and would require quite a bit of changes and potentially is error-prone.
Might take a deeper look at it once I'm done with my exporter.
This is very similar to #18 only I'm using the GaugeMetricFamily/CounterMetricFamily interface, otherwise the symptoms are the same. I'm using the default pypi version (which I think is 0.2.0).
I was inadvertently passing in ints for a couple of the label values in
.add_metric()
, which results in a 500 error on export and the following traceback. Wrapping astr()
around the values makes this go away. Coercing these values as was done in the fix for #18 seems like the right thing to do here as well.