question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sending metrics to StatsD don't specify any metric type

See original GitHub issue

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:

  1. 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.
  2. 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
evernatcommented, Apr 15, 2018

1.72 is available now

0reactions
Hamm-mcommented, Apr 4, 2018

Thanks! Is there any estimation when 1.72 will be available?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metric Submission: DogStatsD - Datadog Docs
This section shows typical use cases for metrics split down by metric types, and introduces sampling rates and metric tagging options specific to...
Read more >
Monitoring StatsD: metric types, format & code examples
In this post we describe the StatsD metrics architecture, metrics types and formats, proving code examples for the Golang, NodeJS/Javascript ...
Read more >
Retrieve custom metrics with StatsD - Amazon CloudWatch
Viewing StatsD metrics imported by the CloudWatch agent · In the navigation pane, choose Metrics. · Choose the namespace for the metrics collected...
Read more >
Introduction to StatsD | HostedMetrics
Types of Metrics in StatsD. Gauges. Gauges in StatsD allow you to directly specify the values you want to send to the metrics...
Read more >
[Guide] Get the custom metrics you want with StatsD and Sensu
In each demo, we compile the example code and send it to the Sensu StatsD listener, using three different data types: counter, gauge,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found