java-dogstatsd-client icon indicating copy to clipboard operation
java-dogstatsd-client copied to clipboard

Special characters are not escaped

Open deadok22 opened this issue 2 years ago • 0 comments

The library does not escape special characters in metric names and tags, which can result in malformed packets and unexpected tags being sent over the wire.

E.g. this:

        final NonBlockingStatsDClient c = new NonBlockingStatsDClient("", "localhost", 8125);
        c.gauge("check:11|g#this:out", 42, "tag1,tag2,tag3");
        c.close();

Results in:

$ nc -u -l localhost 8125
check:11|g#this:out:42|g|#tag1,tag2,tag3

deadok22 avatar Jul 29 '22 03:07 deadok22