Closed timtebeek closed 9 years ago
I’ve run into this too, the problem is two-fold:
iteritems
in https://github.com/Cue/scales/blob/master/src/greplin/scales/graphite.py#L104 to decide whether to send something. iteritems
is Python 2 only thus it has to be: if hasattr(value, 'iteritems') or (six.PY3 and hasattr(value, 'items')):
(although hasattr
should be avoided but that’s a different story altogether).str
, therefore unicode. So there has to be a guard encoding it to bytes.IOW, nobody has ever used GraphitePusher
with Python 3 until now. :disappointed:
Thanks for looking into this! Do you recon it would be easy to work your findings into a pull request or (temporary) fork? I'd be willing to help out if needed..
I’ve submitted a PR, let’s see what the maintainers say. I honestly hope a fork won’t be necessary because I don’t have any time to maintain another project. :)
Great work, hope to see this merged soon!
Using the below code:
Running in python 2.7.6 correctly sends the data to graphite. Running in python 3.4.0 logs the exact same messages, but fails to send: Nothing is received when watching carbon logs on the graphite server.
What can I do to send data to graphite from python3?