Skip to main content

Dropwizard metrics plugin

If your application uses Dropwizard Metrics to collect and monitor metrics,

HexDroid offers a reporter plugin. You can add it to your existing system with a few small adjustments, allowing your application to send metrics directly to HexDroid without significant reconfiguration.

This makes it simple to track and analyze your application's data in one place, without overhauling your current setup.

Setup

Add dependencies

To enable DropwizardMetrics, add the following artifact to your build.gradle.kts (Kotlin DSL) or build.gradle ( Groovy):

implementation("com.hexdroid.client.metrics:dropwizard:0.0.1")

Latest version can be found on Maven Central

Install

val registry = MetricRegistry()

HexDroidReporter.forRegistry(registry)
.build(hexDroidReportingClient)
.start(60, TimeUnit.SECONDS)

Configure

If you wish to fine-tune reporting plugin, you can configure it as such:

HexDroidReporter.forRegistry(registry) {
rateUnit = TimeUnit.SECONDS
durationUnit = TimeUnit.MILLISECONDS
}.build(hexDroidReportingClient).start(60, TimeUnit.SECONDS)