Home

Awesome

Build Status Download

Dependencies

Quick Start

Get the artifacts

Artifacts are released in Bintray. For sbt, use resolvers += Resolver.jcenterRepo, for gradle, use the jcenter() repository. For maven, go here and click "Set me up".

SBT:

libraryDependencies += Seq(
  "com.typesafe.play" %% "play" % "2.5.10",
  "io.dropwizard.metrics" % "metrics-core" % "3.1.2",
  "de.khamrakulov.metrics-reporter-play" %% "reporter-core" % "1.0.2"
)

Maven:

<dependency>
  <groupId>de.khamrakulov.metrics-reporter-play</groupId>
  <artifactId>reporter-core_2.11</artifactId>
  <version>1.0.2</version>
  <type>pom</type>
</dependency>

Gradle:

compile 'de.khamrakulov.metrics-reporter-play:reporter-core_2.11:1.0.2'

Add the module MetricsReporterModule to your application.conf

play.modules.enabled += "de.khamrakulov.play.metrics.MetricsReporterModule"

Use it

The MetricsReporter will create and appropriately register reporters for configured registry.

Configuration Reference

Metrics
metrics {
  registry = "default"
}
NameDefaultDescription
registrydefaultRegistry name to be used
All Reporters
metrics {
  reporters = [
    {
      type: <type>
      durationUnit: "milliseconds"
      rateUnit: "seconds"
      frequency: "1 minute"
    }
  ]
}
NameDefaultDescription
durationUnitmillisecondsThe unit to report durations as. Overrides per-metric duration units.
rateUnitsecondsThe unit to report rates as. Overrides per-metric rate units.
frequency1 minuteThe frequency to report metrics. Overrides the default.
Console Reporter
metrics {
  reporters = [
    {
      type: "console"
      timeZone: "UTC"
      output: "stdout"
    }
  ]
}
NameDefaultDescription
timeZoneUTCThe timezone to display dates/times for.
outputstdoutThe stream to write to. One of stdout or stderr.
Graphite Reporter
metrics {
  reporters = [
    {
      type: "graphite"
      host: "localhost"
      port: "8080"
      prefix: <prefix>
      sender: <sender>
    }
  ]
}
NameDefaultDescription
hostlocalhostThe hostname of the Graphite server to report to.
port8080The stream to write to. One of stdout or stderr.
prefix(none)The prefix for Metric key names to report to Graphite.
sendergraphiteSender that is used to send metrics to Graphite.
Ganglia Reporter
metrics {
  reporters = [
    {
      type: "ganglia"
      host: localhost
      port: 8649
      mode: unicast
      ttl: 1
      uuid: (none)
      spoof: "localhost:8649"
      tmax: 60
      dmax: 0
      prefix: <prefix>
    }
  ]
}
NameDefaultDescription
hostlocalhostThe hostname (or group) of the Ganglia server(s) to report to.
port8649The port of the Ganglia server(s) to report to.
modeunicastThe UDP addressing mode to announce the metrics with. One of unicast or multicast.
ttl1The time-to-live of the UDP packets for the announced metrics.
uuid(none)The UUID to tag announced metrics with.
spoof(none)The hostname and port to use instead of this nodes for the announced metrics. In the format hostname:port.
tmax60The tmax value to announce metrics with.
dmax0The dmax value to announce metrics with.
prefix(none)The prefix for Metric key names to report to Graphite.

TODO