How to use Jmx exporter JavaAgent as a sidecar container

325 views
Skip to first unread message

tantan hngo

unread,
May 12, 2023, 8:29:54 AM5/12/23
to Prometheus Users
As title suggests, I want to run the javaagent in the same pod as our Tomcat.
How do I run the javaagent commands towards our .war file that is in the other container?

I tried just running the agent by itself and let it listen on the port that we've defined in our tomcat to expose its JMX but nothing.

I get various errors depending on how I do things like; httpserverclass missing error, no main manifest attribute in jmx_prom_javagent.jar etc

Any ideas? <3

Doug Hoard

unread,
Jul 10, 2023, 10:45:10 AM7/10/23
to Prometheus Users
The Java agent version (jmx_prometheus_javaagent.jar) is meant to run as an agent attached to the application (in your case Tomcat.) If you want to run as a sidecar, I suspect you want the standalone version (jmx_prometheus_httpserver.jar.)

Reply all
Reply to author
Forward
0 new messages