I try to use hystrix-servo-metrics-publisher to exposes the hystrix circuit breaker status through JMX
pom.xml
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-servo-metrics-publisher</artifactId>
<version>1.1.2</version>
</dependency>
Code
public class SomeClass() {
static {
HystrixPlugins.getInstance().registerMetricsPublisher(HystrixServoMetricsPublisher.getInstance());
}
}
but com.netlix.servo is not available at JMX MBeans/attributes.
Is this single line enough in order that hystrix-servo-metrics-publisher works?
What I need to see Hystrix Metrics via JMX?
The code sample in the Wiki is quite old. Can you try to use a recent version? Latest is 1.5.9.
Hello Matt,
thanks for your answer. I tried it, but unfortunately it doesn't work too. I created a small project
https://github.com/hystrixFan/hystrix-servo-metrics-publisher-jmx-example
Can you say what is wrong at this project?
Best regards
Hans
Nothing obviously wrong, though I'm not very familiar with Spring Boot and how it configures itself. If I was debugging, I would add some printlns around the servo publisher registration to confirm it's getting executed.
Thanks for the hint. The static block was in a class that was not anywhere used and its loading wasn't triggered. I moved the block to the class ExampleApplication.java and it works now.
Most helpful comment
Thanks for the hint. The static block was in a class that was not anywhere used and its loading wasn't triggered. I moved the block to the class ExampleApplication.java and it works now.