Questions tagged [codahale-metrics]

A java library to collect metrics about a software, especially servers, during run time and send it to a central system such as StatsD or graphite.

The Metrics library written by Codahale while working at Yammer has gained a strong following in the Java server development community. This library was novel at its inception in that it aggregated metrics on the server node itself and then sent pre-aggregated metrics a central system such as or . This allows you to use the spare CPU cycles and memory for aggregation. Most application servers are not run to capacity and hence there is a lot of available free resources. It would be more expensive to run the same aggregation on a central node or cluster. Pre-aggregation also saves on network bandwidth as the raw metrics could be generated at a very high rate. With on-node aggregation all the metrics are aggregated in memory locally and only shipped to central systems periodically.

In addition the codahale library allows you to easily integrate application specific metrics in addition to more general server metrics that would be captured by traditional systems such as CollectD or JMX.

There are ports of codahale's metrics Libraries in several languages including:

132 questions
76
votes
1 answer

DropWizard Metrics Meters vs Timers

I am learning the DropWizard Metrics library (formerly Coda Hale metrics) and I am confused as to when I should be using Meters vs Timers. According to the docs: Meter: A meter measures the rate at which a set of events occur and: Timer: A timer…
smeeb
  • 27,777
  • 57
  • 250
  • 447
44
votes
8 answers

Codahale Metrics: using @Timed metrics annotation in plain Java

I am trying to add metrics to a plain Java application using codahale metrics. I'd like to use the @Timed annotation, but it is unclear to me which MetricRegistry it uses, or how to tell it which MetricRegistry to use. The application is a plain…
Rolf
  • 7,098
  • 5
  • 38
  • 55
23
votes
2 answers

How do I configure HikariCP and Dropwizard/Coda-Hale metrics in Spring Boot application

Reading the instructions on the HikariCP wiki about how to enable the Dropwizard metrics, it says to just configure a MetricsRegistry instance in HikariConfig or HikariDatasource. Problem is, in Spring Boot, all the configuration is handled by…
Kevin M
  • 2,717
  • 4
  • 26
  • 31
13
votes
5 answers

Spark streaming custom metrics

I'm working on a Spark Streaming program which retrieves a Kafka stream, does very basic transformation on the stream and then inserts the data to a DB (voltdb if it's relevant). I'm trying to measure the rate in which I insert rows to the DB. I…
Gideon
  • 2,211
  • 5
  • 29
  • 47
12
votes
1 answer

DropWizard not registering my health check

In my DropWizard (v0.7.0) app, I have a DummyHealthCheck like so: public class DummyHealthCheck extends HealthCheck { @Override protected Result check() throws Exception { return Result.healthy(); } } Then in my main Application…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
11
votes
2 answers

Dropwizard metrics - How to reset counters after reporting interval

I am using codahale metrics (now dropwizard metrics) to monitor a few 'events' happening in my system. I am using the counters metrics to keep track of number of time the 'event' happened. I checked the values printed by the reporter for my counter…
face
  • 1,503
  • 13
  • 27
11
votes
1 answer

How to retrieve Metrics like Output Size and Records Written from Spark UI?

How do I collect these metrics on a console (Spark Shell or Spark submit job) right after the task or job is done. We are using Spark to load data from Mysql to Cassandra and it is quite huge (ex: ~200 GB and 600M rows). When the task the done, we…
10
votes
2 answers

Functional interfaces in Java 8

I'm having a hard time sorting out why lambda expressions are assignable to some functional interfaces, but not others. An example, using some functional interfaces from the Metrics library: Gauge foo = () -> { return null; }; RatioGauge bar…
Josh Stone
  • 4,328
  • 7
  • 29
  • 37
7
votes
1 answer

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 3.2.2 Now that, we are…
Naman
  • 27,789
  • 26
  • 218
  • 353
7
votes
0 answers

Is there any way to combine the Slf4jReporter with the metrics-json package to generate JSON in the logs

Is there any way to combine the Slf4jReporter with the metrics-json package to generate JSON in the logs? reporter = Slf4jReporter.forRegistry(registry) .outputTo(logger) …
7
votes
1 answer

Register MetricRegistry inside Dropwizard Bundle

I am creating a Dropwizard Bundle to be reused across all my microservices. One of the things I would like to standardize on is the MetricRegistry each service uses. It would be great if I could I could configure each service to use the same…
smeeb
  • 27,777
  • 57
  • 250
  • 447
6
votes
1 answer

Exporting metrics in spring boot

spring boot shows all the possible metrics in /metrics endpoint. on the other hand, internally it uses metrics exporters. for example when you add dropwizard metrics (current de facto standard?) it gets registered automatically but not all…
piotrek
  • 13,982
  • 13
  • 79
  • 165
6
votes
1 answer

Reporting JVM's CPU usage with Dropwizard metrics

I use Dropwizard metrics to measure various metrics in my application. They are several predefined reporters in JVM instrumentation, but strangely I could not find any reporting the CPU usage. I could create my own Gauge (using getThreadCpuTime or…
Benoît
  • 1,080
  • 11
  • 28
6
votes
1 answer

How to calculate distribution (Histogram) of large amount of data in a distributed system?

I am building a metrics reporting system on an instance fleet containing more than 100,000 front-end instances. For any request, every single instance will have a response time. And what I need is the distribution of the response time of every kinds…
5
votes
2 answers

How is codahale metrics Meter mark() method threadsafe?

I have recently begun to learn CodaHale/DropWizard metrics library. I cannot understand how is the Meter class thread-safe (it is according to the documentation), especially mark() and tickIfNecessary() methods…
Xenon
  • 189
  • 1
  • 1
  • 14
1
2 3
8 9