New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending metrics to StatsD don't specify any metric type #737
Comments
It seems that I have forgotten to include the metric type indeed. Sorry. |
No worries mate! I'm not entirely sure about the gauge data type to be honest. I'm pretty new in StatsD but my understanding is that the only metric type that automatically does some data-processing is Timer. Counter and Gauge feels to just pass the value to the server and the problem I see with Gauge is that it ignores all except the last value that comes within an interval. So if activeThreads are e.g. 100+ most of the time but then it jumps down to 20 at the end of the interval, the information about high peaks might disappear occasionally. This article is one of a very few where I read a decent description of the resulted behaviour when using various metric types and after reading it, I'm under impression that Timer might be more useful from client perspective as it includes additional information as avg/min/max etc. What do you think? |
I still think that the gauge data type should be used, because metrics are sent by javamelody once per minute and can be seen as already aggregated by javamelody. For example, the %cpu metric is averaged for a minute. Is it ok for you? |
Thanks, that makes sense to me. It feels slightly inconsistent with the "recommended" semantic of StatsD metric types but as long as Java Melody makes the aggregation for us, it sounds like we will have transparent results from the client perspective in any case. In short, sure, go ahead with gauge! :] ..and thanks for quick replies! |
Fixed by 7f4297f and ready for the next release (1.72). |
Thanks! Is there any estimation when 1.72 will be available? |
1.72 is available now |
Since 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:
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)
The text was updated successfully, but these errors were encountered: