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

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

Description

@goir

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 ?

Activity

  1. vmg commented on Jun 22, 2015

    @vmg
    Contributor

    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. :)

  2. pmyjavec commented on Jun 24, 2015

    @pmyjavec

    Works on my machine ;)

  3. loyd commented on Nov 21, 2018

    @loyd

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

  4. genuss commented on Nov 21, 2018

    @genuss

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions