I have an app deployed to Cloudfoundry that I've exposed JMX MBeans interfaces for our logging levels. I'd like to connect to the cloudfoundry instances with jconsole. Is this possible? How do I make this happen? What if I'm running more than 1 instance of Tomcat, how do I connect to a specific instance? or does it matter?
There is currently no way to connect to once specific instance of an application or for that matter any port other than http port via the main Cloud Foundry router.
In the platform we use an app deployed alongside the Login and UAA components (https://github.com/cloudfoundry/identity-tools/tree/master/varz). It gives read-only access to selected MBeans through a CF-like REST interface. It is opinionated about the most important MBeans to expose and may break on complex object graphs, but you can adapt it if you want. You could rip out the controller and use it in your app or do the same as we do in the platform with a standalone app, deploying your own war and the varz in the same container.
Also see Jolokia for a generic JMX REST wrapper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With