3

I recently started exploring various options in dropwizard metrics and used GraphiteReporter for reporting these to Graphite installed on a VM

I created several gauges, timer and counters and most of the data was correctly displayed on graphite composer window. But specifically in case where I am creating a gauge with String data type, for example:

final MetricRegistry metrics = new MetricRegistry();
       Gauge<String> hosts = new Gauge<String>() {

                    public String getValue() {
                        return "172.0.0.1";
                    }

                };
    metrics.register("hostDetails", hosts);

The "hostDetails" gauge does not gets reflected on Graphite. When I print the metrics(in console) using ConsoleReporter, all metrics(including string gauges) are printed in console with correct values.

Since the String gauge values are printed in console, this means that the gauge is created properly but somehow it is not getting reflected in Graphite. I am using the similar code for Integer and Long data type gauges and those are reported correctly in Graphite. Please advise if anyone has faced similar issue before or have some insight on the required fix.

Jay
  • 31
  • 3

0 Answers0