Exports avaje-metrics to StatsD / DogStatsD using the Datadog Java client.
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-metrics-statsd</artifactId>
<version>${version}</version>
</dependency>import io.avaje.metrics.statsd.StatsdReporter;
import java.util.concurrent.TimeUnit;
StatsdReporter reporter = StatsdReporter.builder()
.hostname("localhost")
.port(8125)
.tags(new String[]{"env:dev", "service:billing"})
.schedule(60, TimeUnit.SECONDS)
.timedThresholdMicros(1_000)
.build()
.start();
// close on shutdown
reporter.close();hostname(...)/port(...)— destination host and porttags(...)— common StatsD tagsclient(...)— supply a customStatsDClientschedule(...)— reporting intervaltimedThresholdMicros(...)— suppress low-value timer metricsregistry(...)— use a non-default registrydatabase(...)/databaseVerbose(...)— include Ebean metrics directly
If client(...) is used, the hostname, port, and tags settings are ignored.