Skip to content

Instantly share code, notes, and snippets.

@benhubert
Created September 20, 2017 11:54
Show Gist options
  • Save benhubert/8c5860172e6d20d6008b4d9309f107ba to your computer and use it in GitHub Desktop.
Save benhubert/8c5860172e6d20d6008b4d9309f107ba to your computer and use it in GitHub Desktop.
Spring Boot configuration for collecting metrics with StatsD
@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