I want to connect a wso2-apim 4.1.0 instance by means of JMX exporter toward Prometheus instance. Following the article https://lashan.medium.com/monitoring-wso2-products-with-prometheus-4ace34759901, I altered the api-manager.sh script
$JAVACMD \
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
$JVM_MEM_OPTS \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
$JAVA_OPTS \
-verbose \
-javaagent:/apps/wso2/wso2am-4.1.0/lib/jmx_prometheus_javaagent-0.18.0.jar=1234:/apps/wso2/wso2am-4.1.0/repository/conf/wso2config.yaml \
-Dcom.sun.management.jmxremote \
The javaagent jar file is present and the yaml file contains:
startDelaySeconds: 30
jmxUrl: service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi
ssl: false
lowercaseOutputName: true
username: admin
password: admin
carbon.xml contains
<!-- The JMX Ports -->
<JMX>
<!--The port RMI registry is exposed-->
<RMIRegistryPort>9999</RMIRegistryPort>
<!--The port RMI server should be exposed-->
<RMIServerPort>11111</RMIServerPort>
</JMX>
However upon running ./api-manager.sh , the JVM is started, but it stops after 1 second. The -verbose option shows some 170 prometheus-related classes to be loaded and it stops with
0.527s][info][class,load] io.prometheus.jmx.JmxCollector$Config source: file:/apps/wso2/wso2am-4.1.0/lib/jmx_prometheus_javaagent-0.18.0.jar
[0.528s][info][class,load] io.prometheus.jmx.JmxCollector$Rule source: file:/apps/wso2/wso2am-4.1.0/lib/jmx_prometheus_javaagent-0.18.0.jar
[0.528s][info][class,load] io.prometheus.jmx.MatchedRulesCache source: file:/apps/wso2/wso2am-4.1.0/lib/jmx_prometheus_javaagent-0.18.0.jar
[0.529s][info][class,load] java.util.logging.LogRecord source: shared objects file
[0.529s][info][class,load] java.util.IdentityHashMap$IdentityHashMapIterator source: shared objects file
[0.529s][info][class,load] java.util.IdentityHashMap$KeyIterator source: shared objects file
[0.530s][info][class,load] java.util.WeakHashMap$Values source: jrt:/java.base
[0.530s][info][class,load] java.util.WeakHashMap$HashIterator source: jrt:/java.base
[0.530s][info][class,load] java.util.WeakHashMap$ValueIterator source: jrt:/java.base
[0.530s][info][class,load] java.io.FileOutputStream$1 source: jrt:/java.base
wso2carbon.log is empty.
Any idea how to correct this?
Rgds
Luc