zio / zio-metrics-legacy

⛔️ DEPRECATED
https://zio.github.io/zio-metrics
Apache License 2.0
56 stars 39 forks source link

statsd metrics are limited to 512 bytes #123

Open andrewhamon opened 2 years ago

andrewhamon commented 2 years ago

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.

toxicafunk commented 2 years ago

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

andrewhamon commented 2 years ago

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) 😸

ollyw commented 2 years ago

@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