Search code examples
javaglassfishmonitoringjmxnetflix

HystrixCommand not exposed via JMX when run in Glassfish


This seems to be a glassfish specific issue.

When we deploy copies of the same application to Jetty, we are able to see the Hystrix metrics under MBeans via JConsole.

However, when the same application is deployed to Glassfish, we don't seem to get the same information. HystrixCommand references are no where to be found. As far as I can tell, Glassfish is configured correctly in this sense.

My experience with the Netflix API and Glassfish stack is fairly limited, so please let me know if there is more relevant information that I can provide.


Solution

  • There is a race condition that can occur if any Hystrix commands are executed prior to registering the Servo Hystrix metrics publisher. You must make sure that the Servo publisher is registered prior to executing any commands. When a command is executed and there is no registered metrics publisher the default metrics publisher will be used, and there is no exposed way to change the publisher.

    See https://github.com/Netflix/Hystrix/issues/150 for another user with a similar problem.