Created
September 20, 2017 11:54
-
-
Save benhubert/8c5860172e6d20d6008b4d9309f107ba to your computer and use it in GitHub Desktop.
Spring Boot configuration for collecting metrics with StatsD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class MetricsConfig { | |
@Bean | |
public StatsDClient statsDClient( | |
@Value("${metrics.statsd.host:localhost}") String host, | |
@Value("${metrics.statsd.port:8125}") int port, | |
@Value("${metrics.prefix:example.app}") String prefix | |
) { | |
return new NonBlockingStatsDClient(prefix, host, port); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment