zio-metrics-legacy icon indicating copy to clipboard operation
zio-metrics-legacy copied to clipboard

statsd metrics are limited to 512 bytes

Open andrewhamon opened this issue 3 years ago • 3 comments

When sending a UDP statsd message, this library always allocates a fixed 512 ByteBuffer. If the data size exceeds this, copying into this buffer will throw a java.nio.BufferOverflowException.

Something like ByteBuffer.wrap is probably more appropriate.

andrewhamon avatar Mar 23 '22 19:03 andrewhamon

I´m having issues publishing a ZIO2.0 compatible version, once that´s done I´ll see if i can fix this. Ofc, PRs are always welcomed :-)

toxicafunk avatar Apr 13 '22 13:04 toxicafunk

Yep, my coworker I think has talked to you on discord, we have a handful of changes we'd like to upstream if possible (some may be more controversial than others) 😸

andrewhamon avatar Apr 18 '22 01:04 andrewhamon

@andrewhamon thanks for putting in these tickets. I am looking at integrating the metrics into prod for a high throughput service and looked at the code and found concerns and was going to put in tickets, but see you have already found and reported the issues. Another minor area for improvement could be to minimise garbage generation e.g. Using ByteBuffer.allocate in UDPClient.send rather than ByteBuffer.wrap seems suboptimal.

Are you planning to upstream some of the changes that you and your coworker have been working on? It would be really handy to have them

ollyw avatar Jul 26 '22 12:07 ollyw