Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to JmxReporter in dropwizard.metrics:metrics-core latest release

Since codahale-metrics have been moved under io.. An implementation in our code was making use of the class:

import com.codahale.metrics.JmxReporter

with the dependency version

<metrics.core.version>3.2.2</metrics.core.version>

Now that, we are planning to upgrade to the latest release for the artifact

<metrics.core.version>4.1.0-rc3</metrics.core.version>

this no more has the class we were using, has this been migrated to some other artifact or is there an alternative to using the JmxReporter now?

PS: Have searched for their release notes and alternatives the over internet but couldn't find a relevant result to this yet.

like image 530
Naman Avatar asked Feb 06 '19 05:02

Naman


People also ask

What is Coda Hale metrics?

Lightbend Telemetry supports Coda Hale Metrics, which is a toolkit for gathering metrics. Coda Hale Metrics supports various reporting plugins, and can be used to export actor metrics data to your own monitoring infrastructure.

What are Java metrics?

Metrics is a Java library which gives you unparalleled insight into what your code does in production. Metrics provides a powerful toolkit of ways to measure the behavior of critical components in your production environment.

What is MetricRegistry?

public class MetricRegistry extends Object implements MetricSet. A registry of metric instances.

What is Dropwizard metrics meter?

These metrics are dropwizard meter metrics which capture the moving average values for 1-, 5-, and 15-minute. select * from "messages" limit 10 time ... I am using dropwizard metrics meter to count the total number of requests my application receives.

Can I use multiple metrics registries for the same metrics?

We can use one metrics registry for all of our metrics, but if we want to use different reporting methods for different metrics, we can also divide our metrics into groups and use different metrics registries for each group. Let's create a MetricRegistry now:

What is metrics in Jenkins?

Metrics provides a powerful toolkit of ways to measure the behavior of critical components in your production environment. With modules for common libraries like Jetty, Logback, Log4j, Apache HttpClient , Ehcache, JDBI, Jersey and reporting backends like Graphite, Metrics provides you with full-stack visibility.

What is metrics in Java?

Introduction Metrics is a Java library which provides measuring instruments for Java applications. It has several modules, and in this article, we will elaborate metrics-core module, metrics-healthchecks module, metrics-servlets module, and metrics-servlet module, and sketch out the rest, for your reference. 2. Module metrics-core 2.1.


1 Answers

After some hours of wait and searching through each incremental release notes, I could find it in the release notes of version 4.0.0 that has an item listed as:

Move JMX reporting to the metrics-jmx module

Hence now the correct way to use the class JmxReporter would be to using the dependency on different module:

<dependency>
    <groupId>io.dropwizard.metrics</groupId>
    <artifactId>metrics-jmx</artifactId>
    <version>4.1.0-rc3</version>
</dependency>

and also that the package in the imports needs to be modified as:

import com.codahale.metrics.jmx.JmxReporter;
like image 148
Naman Avatar answered Oct 18 '22 02:10

Naman