Code Monkey home page Code Monkey logo

kamon-statsd's Introduction

StatsD Integration Build Status

Gitter Maven Central

StatsD is a simple network daemon that continuously receives metrics over UDP and periodically sends aggregate metrics to upstream services like (but not limited to) Graphite. Because it uses UDP, sending metrics data to StatsD is very fast with little to no overhead.

Getting Started

The kamon-statsd module is currently available for Scala 2.10, 2.11 and 2.12.

Supported releases and dependencies are shown below.

kamon-statsd status jdk scala
1.0.0 stable 1.8+ 2.10, 2.11, 2.12

To get started with SBT, simply add the following to your build.sbt file:

libraryDependencies += "io.kamon" %% "kamon-statsd" % "1.0.0"

and add the StatsD reporter to Kamon:

Kamon.addReporter(new StatsDReporter())

Integration Notes

Network Settings

At the very basic level, you will certainly want to use the kamon.statsd.hostname and kamon.statsd.port configuration keys to ensure your data is being sent to wherever your StatsD instance is running.

Metric Names

Since StatsD has a hierarchical metrics model this module has to apply special rules to convert Kamon's metric name + tags into a single metric name that contains all this inforamtion. By default the following format will be used:

[service-name].[hostname].[metric-name].[tag[0].name].[tag[0].value].[tag[1].name].[tag[1].value]...

Where tags are ordered alphabetically before being added to the metric name. If you wish to change the the way metric keys are generated you can supply your own implementation of kamon.statsd.MetricKeyGenerator using the kamon.statsd.metric-key-generator setting.

Metric Units

Kamon keeps all timing measurements in nanoseconds and memory measurements in bytes. In order to scale those to other units before sending to StatsD, set time-units and memory-units config keys to desired units. Supported units are:

n  - nanoseconds
µs - microseconds
ms - milliseconds
s  - seconds

b  - bytes
kb - kilobytes
mb - megabytes
gb - gigabytes

For example, the following setting:

kamon.statsd.time-units = "ms"

will make the kamon-statsd module scale all timing measurements to milliseconds right before sending to StatsD.

Visualization and Fun

StatsD is widely used and there are many integrations available, even alternative implementations that can receive UDP messages with the StatsD protocol, you just have to pick the option that best suits you. For our internal testing we choose to use Graphite as the StatsD backend and Grafana to create beautiful dashboards with very useful metrics. Have an idea of how your metrics data might look like in Grafana with the screenshot bellow or use our docker image to get up and running in a few minutes and see it with your own metrics!

TODO: Update the dashboards and images.

kamon-statsd's People

Contributors

alessandrosimi-sa avatar amnesiac avatar dpsoft avatar ivantopo avatar jozic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.