Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

Statsd server uses \n as separator for multiple metrics #16

Open
goir opened this issue Jun 18, 2015 · 4 comments
Open

Statsd server uses \n as separator for multiple metrics #16

goir opened this issue Jun 18, 2015 · 4 comments

Comments

@goir
Copy link
Contributor

goir commented Jun 18, 2015

The official statsd node client uses \n as separator for multiple metrics in a single packet.

https://github.com/etsy/statsd/blob/master/docs/server.md
"Multiple metrics can be received in a single packet if separated by the \n character."

Update:
A simple python script to test this:

import socket
addr = (socket.gethostbyname('localhost'), 8126)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print sock.sendto('foo.baz:1|c\nfoo.def:1|c\n', addr)

This gives me
instance=brubeck_debug sampler=statsd event=bad_key key='foo.baz:1|c
foo.def:1|c
' from=127.0.0.1

If I use "\0" or "\n\0" as the separator I don't the the error but just the first metric is send to carbon.

Is it possible to support multiple metrics in one package ?

@vmg
Copy link
Contributor

vmg commented Jun 22, 2015

Hi @goir! Multiple metrics in one package can be supported, but these are one of the features we didn't implement because we don't use them in production. Pull requests are always welcome. :)

@pmyjavec
Copy link

Works on my machine ;)

@loyd
Copy link

loyd commented Nov 21, 2018

So, it's already implemented, am I right?

@genuss
Copy link

genuss commented Nov 21, 2018

Looks like so, but beware enabling recvmmsg it can cause issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants