Open MatzHilven opened 11 months ago
I believe you can, but by default carbon.conf
has that feature disabled:
ENABLE_UDP_LISTENER = False
UDP_RECEIVER_INTERFACE = 0.0.0.0
UDP_RECEIVER_PORT = 2003
However, this client uses LazySocket that calls for a normal Socket creation which is only TCP. Support for UDP would require a PR at this stage.
Are you able to submit such a change ? If not, I can look into it.
I'm not very experienced in js, but it looks like the net
module has only got support for TCP clients. Seems like dgram
would be good for this job?
That is correct, it's just a matter of calling the right type of socket within LazySocket, but this is outside the scope of this repo and I can only approve PRs here. Thus, I suggest we implement UDP support without dependencies as it's pretty straightforward.
I will think of a first draft to then use for tests and ping you when it's ready.
Perfect, thanks!
I just pushed the initial version with UDP support on the feat-udp branch. Can you pull it and try locally ?
You will also need to change the connect string: replace plaintext
with udp
. See README for an example.
Any updates @MatzHilven ? If it works well, I will merge into master.
I'll get you an answer this evening!
Shameless ping @MatzHilven :)
Sorry for the delay!! LGTM 😊
Also: https://github.com/felixge/node-graphite/pull/20#issuecomment-1811197602
Is it possible to connect to carbon via UDP? (using this client of course)