Sending metrics to StatsD don't specify any metric type
See original GitHub issueSince Java Melody 1.70.0, there should be support for sending metrics from Java Melody to StatsD. If I’m not mistaken, it was implemented in issue #678.
The problem I face is that although metrics are send to the StatsD deamon, there are no metric types specified for any of it’s datagrams.
There are two negative consequences:
- Each datagram send by Java Melody causes "Bad line: 1.00 in msg “javamelody.xxx.hostname.cpu:1.00” error thrown by StatsD as it can’t be parsed properly by StatsD deamon.
- StatsD deamon don’t seem to be able to process datagrams with no metric type specified. These datagrams are counted in “statsd.metrics_received” (and because of (1) also in “statsd.bad_lines_seen”) but all the information about their actual value is lost.
The second issue is obviously more severe as it prevents client from using statistic for anything useful. E.g. if you want to track activeThreads, you don’t have the actual value of the active threads in hands.
When I experimentally tried to patch Java Melody and changed Statsd.java : line 99 to include e.g. counter metric type at the end of each datagram:
bufferWriter.append(decimalFormat.format(value)).append("|c").append('\n');
…each of the datagram I handled separately as counter and thus I at least see the information about what kind of statistics Java Melody sends. (Obviously not every one of them should be counter metric type)
I believe that each of the datagram send by Java Melody should either have it’s metric type pre-specified based on it’s logical use in statistics or it should be explicitly configurable by the client. (Or maybe the combination of the two would be ideal, pre-specified types that could be possibly overridden by client)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
1.72 is available now
Thanks! Is there any estimation when 1.72 will be available?