hmrc / play-graphite   3.6.0-1-gb19814d

Apache License 2.0 GitHub

A library that can hook to a Play Global object to start the Graphite reporter.

Scala versions: 2.11

play-graphite

This library is deprecated now. Please use bootstrap-play to use features from this library

A library that can hook to a Play Global object to start the Graphite reporter.

For this to work, we also need to use the GraphiteMetricsModule which actually sends the metrics data to a MetricsRepository. The GraphiteReporter then picks it up from there and sends the data to the Graphite server.

Adding to your service

Include the following dependency in your SBT build

resolvers += Resolver.bintrayRepo("hmrc", "releases")

libraryDependencies += "uk.gov.hmrc" %% "play-graphite" % "x.x.x"

Required configuration

This library shares a part of its configuration with the MetricsPlugin (in the configuration root), namely

metrics {
    name = metrics-repository-name
    enabled = true
}

It also has its own configuration at a location given by overriding microserviceMetricsConfig

metrics {
    graphite {
        host = graphite
        port = 2003
        prefix = appMetricsPrefix
        enabled = true
    }
}

License

This code is open source software licensed under the Apache 2.0 License.