Does anyone have experience integrating AEM with Prometheus JMX Exporter (GitHub - prometheus/jmx_exporter: A process for exposing JMX Beans via HTTP for Prometheus consumpti...
I am trying to setup a monitoring/alerting system in place for some of the key metrics such as replication queues etc.
Solved! Go to Solution.
Yes I do. Quite easy actually. Just use the java agent and put the required java startup parameters in your CQ_JVM_OPTS environment variable before starting AEM.
Be be sure to whitelist only the beans you need. By default all JMX beans are monitored and in AEM that is quite a lot.
Views
Replies
Total Likes
Yes I do. Quite easy actually. Just use the java agent and put the required java startup parameters in your CQ_JVM_OPTS environment variable before starting AEM.
Be be sure to whitelist only the beans you need. By default all JMX beans are monitored and in AEM that is quite a lot.
Views
Replies
Total Likes
Nice response
Views
Replies
Total Likes
I have been trying to get this too work with the jmx_prometheus_httpserver-0.3.1-jar-with-dependencies.jar jar file, but it trows a bunch of errors in the logs.
*WARN* [RMI TCP Connection(175)-<IP Address>] org.apache.jackrabbit.oak.jcr.session.RefreshStrategy This session has been idle for 4 minutes and might be out of date. Consider using a fresh session or explicitly refresh the session.
java.lang.Exception: The session was created here:
Do you know why this is happening? Can you provide a sample on how to use the java agent with AEM?
Views
Replies
Total Likes
Some JMX beans in AEM don't properly close their JCR session, which causes the errors you see.
I opened some Daycare issues to report that.
Best is to whitelist only the JMX beans you want to extract data from (depends on your monitoring needs).
Download the prometheus Java agent jar as described on GitHub - prometheus/jmx_exporter: A process for exposing JMX Beans via HTTP for Prometheus consumpt... and copy it into /usr/local/bin/jmx_prometheus_javaagent.jar
Edit the file crx-quickstart/bin/start-env and add following line:
JVM_OPTS='-javaagent:/usr/local/bin/jmx_prometheus_javaagent.jar=9242:/etc/prometheus/jmx-exporter-config.yaml'
Create the file /etc/prometheus/jmx-exporter-config.yaml and give it (for example) following content:
whitelistObjectNames: [
"com.adobe.granite:type=Repository",
"com.adobe.granite.replication:type=agent,*",
"java.lang:*",
"org.apache.jackrabbit.oak:type=\"Standby\",*",
"org.apache.jackrabbit.oak:type=SegmentRevisionGarbageCollection,*",
"org.apache.jackrabbit.oak:type=Metrics,name=SESSION_COUNT",
"org.apache.jackrabbit.oak:type=IndexStats,name=async",
"org.apache.sling:type=queues,*",
"org.apache.sling.installer:type=Installer,name=Sling OSGi Installer",
]
Finally start AEM as follows:
crx-quickstart/bin/start
The prometheus exporter will be running at http://localhost:9242/metrics.
I have tried the above one with multiple configurations but getting the following error
Views
Replies
Total Likes
This worked. Thanks! One thing I have noticed about the JMX Exporter does add to the CPU. if you change it to scrape every 60 - 90 seconds it only adds 4% - 5% to the CPU.
Views
Replies
Total Likes
Thanks for posting this question and answer. This worked well, but I needed to remove the \"Quotes\" around the Standby type (using JMX Exporter 0.5).
For me it didn't seem to add anything to the CPU, even at 5sec polling. 1sec poll added a couple of percent. Perhaps the new version is more performant.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies