Sometimes people are asking me about monitoring Jboss EAP Perfomance. And, to be honest, its hard to give definitive answer. usually, the best way is just to do via Appdynamics. Sadly it is a commercial solution that costs money, so its not always a good answer.
Since Redhat doesn’t have a definitive solution to it currently (JON is already in retirement mode), people are trying to do monitoring manually. However, there are not much information in the wild internet on what to monitor, and how to access the interesting metrics of the EAP.
Luckily, there are some ways to do it. One way would be to do everything via Jboss CLI / REST Interface, but this time I wont extend myself on this topic (unless someone asks me to write about it).
Another way would be to use JOLOKIA. (You guessed it, this post will be about this exactly!)
Briefly about Jolokia: It is an agent, which can be attached to the JVM. After attaching the jolokia agent, all the necessary information can be retrieved via simple GET requests. Since it is only a agent, it doesnt have a fancy GUI. But, because it has really simple information request mechanism, it can be easily integrated into existing monitoring solutions, like Zabbix or Nagios.
In this post, I will try to explain on how to attach Jolokia, and what are the most important vales that can be used.
Firstly, download and extract the Jolokia agent.
In order to attach it to Jboss EAP, you just need to add additional parameter to the jboss startup script:
set "JAVA_OPTS=%JAVA_OPTS% -javaagent:C://<jolokia-path>//jolokia-jvm.jar"
This can be achieved via editing standalone.conf (this is the easiest way).
Once Jboss EAP is started, it is a good sign if you see a line similar to this:
<....>
[stdout] (JolokiaStart) Jolokia: Agent started with URL http://127.0.0.1:8778/jolokia/
<...>Just to see how it works, you can already enter the url that is visible on startup. You should see something similar like this:
{
"request": {
"type": "version"
}, "value": {
"agent": "1.3.7", "protocol": "7.2", "config": {
"maxDepth": "15", "discoveryEnabled": "true", "maxCollectionSize": "0", "agentId": "192.168.178.21-19256-7f31245a-jvm", "debug": "false", "agentType": "jvm", "historyMaxEntries": "10", "agentContext": "\/jolokia", "maxObjects": "0", "debugMaxEntries": "100"
}, "info": {
"product": "JBoss EAP", "vendor": "RedHat", "version": "7.0.0.GA"
}
}, "timestamp": 1509811048, "status": 200
}Once you got this information, everything else it is pretty easy. You just need to find the interesting values and parse them in monitoring tool. However, the trick is to find the values that are interesting! Here some of those are listed:
- Memory of JVM
- http://127.0.0.1:8778/jolokia/read/java.lang:type=Memory
- EAP Generic Information
- http://127.0.0.1:8778/jolokia/read/jboss.as:management-root=server
- Datasource Information
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=datasources,data-source=ExampleDS
- Datasource Pool Information
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool
- Infinispan Caching information
- http://127.0.0.1:8778/jolokia/read/jboss.infinispan:type=CacheManager,name=%22ejb%22,component=CacheManager
- Messaging
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=messaging-activemq,server=default
- Single messaging queues
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=messaging-activemq,server=default,jms-queue=DLQ
- Mod_Cluster
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=modcluster,mod-cluster-config=configuration
- HTTP(S) Listener
- http://127.0.0.1:8778/jolokia/read/jboss.as:subsystem=undertow,server=default-server,http-listener=default
As you can see, there is A LOT of information that can be extracted of one JBoss EAP Instance. If the Admins are really freaky about controlling thing, this Jolokia Agent approach could be a goldmine for them :)
In case you want to monitor something else, you can find the request values relatively easy with Jconsole tool which is bundled together with JDK.
Under Tab Mbeans there are all information that is available for you to read.
Happy Monitoring! In case you have some questions, just leave a comment below.