Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

robertnetz/dogstatsd-spring-boot-starter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

dogstatsd-spring-boot-starter

MIT License Maven metadata URI Build Status

this project will easily push your metrics to a dogstatsd-agent in a spring-boot environment. For now, this project will only support Spring-Boot 1.5.x, since in 2.0.x, spring will introduce Micrometer as an abstraction for pushing metrics to various vendors.

Downloads

Add dogstatsd-spring-boot-starter as dependency.

If you use Maven, add the starter to your dependencies:

<dependency>
    <groupId>com.github.robertnetz</groupId>
    <artifactId>dogstatsd-spring-boot-starter</artifactId>
    <version>1.2</version>
</dependency>

If you use Gradle, add your dependency as follows:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.github.robertnetz:dogstatsd-spring-boot-starter:1.2'
}

Usage

As soon as the starter was added to your project, it will send your actuator metrics to your dogstatsd-agent. by default it will send to localhost:8125.

you can update the configuration by adding new keys to your application.yml as follows.

datadog:
  host: otherhost.example.com
  port: 12345

a feature of the dogstatsd is the tagging-support. to tag all your metrics statically with a provided set of tags, you have to specify them like this:

datadog:
  tags:
    - foo
    - bar
    - bam
    - baz

if you like to have a static prefix to all your metrics, you can do it like that:

datadog:
  prefix: superapp

you also can disable the metrics export by configuration:

datadog:
  enabled: false

You might not want to export spring actuators' SystemPublicMetrics, then you'll have to disable them explicitly by:

datadog:
  includeActuatorMetrics: false

Metric name sanitization

Some libraries you use might be recording metrics with : in their names. These are currently not supported by the java-dogstatsd-client and cause errors. There are a few strategies available:

datadog:
  nameSanitizer: raise  # default

The default strategy is raise, and will raise an exception when a : character is encountered in a metric name. This will allow you to quickly fix any code under your control which reported these metrics.

Other available strategies are:

  • escape: replace any : with a -
  • ignore: silently skip reporting the metric with the illegal name

About

a spring-boot-starter for pushing metrics to a dogstatsd-agent.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages