Monitoring SDL Micro Services via JMX and JConsole
By Jonathan Primmer
Let’s talk tech. In this post, we outline how to set up the profiling of an SDL Spring Boot Micro Service for monitoring of the memory, threads, classes, and MBeans.
The process consists of two parts:
- Configuring the micro service for JMX remote management
- Connecting to the JMX management from the JConsole application (or any other JMX enables monitoring application).
Note: This does impact performance, so it should not be used in a production scenario.
Complete this section in the order presented.
Configuring JMX Remote Management on the Micro Service
- Open the start.sh of your micro service
- Add the following entries to the JVM_OPTIONS
- Djava.rmi.server.hostname=<server ip address>
- Dcom.sun.management.jmxremote.port=<port of your choice>
- Dcom.sun.management.jmxremote.rmi.port=<same port as above>
- Restart the micro service
We’d recommend removing this configuration once you’ve finished monitoring.
Optionally, add the “authenticate” value depending on your authentication requirements. Additional information on providing authentication credentials can be found in the official JMX documentation.
Connect JConsole to Your Micro Service
- Navigate to /Contents/Home/Bin under your JDK folder
- Run the jconsole application
- Under New Connection -> Remote Process enter the host of the server your micro service runs on and the port you configured for your JMX management
- Click Connect
Now you can view the stats of your micro service’s. Note that MBeans allow us to monitor the addition / usage / invalidation of the EhCache. Click the tab and expand the ehcache section to view the details.
Tip: Why not try connecting with the more powerful VisualVM? Simply install the tool and connect just like you did with JConsole.
Update your firewall to allow TCP for the port you configured.
Receive our latest news, articles, and updates.
(No junk. Just the good stuff.)
Content Bloom Wins 2021 SDL Tridion Sites MVP Award
For the 11th consecutive year, Content Bloom has ranked among SDL’s Most Valuable Professionals.
A Recap of Tridion Expert Summit 2020 – Day 2
Here’s a full recap on Day 2 of Tridion Expert Summit 2020.
Hacking the Tridion UDP Library
Follow along as our Tridion Practice Lead, Damian Jewett, walks through how to hack the Tridion UDP library.