#Dropwizard Hystrix Metrics
A library that captures hystrix circuit breaker metrics in provided metrics registry.
- Define maven repository
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
- Add dependency
<dependency>
<groupId>io.github.noorulhaq</groupId>
<artifactId>hystrix-metrics</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Add below lines in your application bootstrap process.
HystrixPlugins.reset();
HystrixPlugins.getInstance().registerMetricsPublisher(new DropWizardMetricsPublisher(metricRegistry))
@Configuration
@EnableMetrics
class MetricsConfiguration extends MetricsConfigurerAdapter{
@Autowired
private MetricRegistry metricRegistry;
@PostConstruct
private void onStartup(){
HystrixPlugins.reset();
HystrixPlugins.getInstance().registerMetricsPublisher(new DropWizardMetricsPublisher(metricRegistry));
}
}
Licensed under Apache Software License 2.0