Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot use jmx_exporter with JBoss 8.0 in Domain mode. #1106

Closed
suraw00t opened this issue Dec 20, 2024 · 1 comment
Closed

I cannot use jmx_exporter with JBoss 8.0 in Domain mode. #1106

suraw00t opened this issue Dec 20, 2024 · 1 comment

Comments

@suraw00t
Copy link

suraw00t commented Dec 20, 2024

Configuration content and error log on JBoss EAP 8.0 in Domain mode.

#host-secondary.xml JBoss config file
...
<servers>
  <server name="server-jvm01" group="server-group1" auto-start="true">
    <jvm name="default">
      <jvm-options>
        <option value="-Xbootclasspath/a:${jboss.home.dir}/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.19.jar"/>
        <option value="-Xbootclasspath/a:${jboss.home.dir}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.6.0.jar"/>
        <option value="-javaagent:${jboss.home.dir}/bin/jmx_prometheus_javaagent.jar=7071:${jboss.home.dir}/bin/jmx_exporter_conf.yaml"/>
      </jvm-options>
    </jvm>
    <system-properties>
      <property name="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
      <property name="jboss.modules.system.pkgs" value="org.jboss.byteman,org.jboss.logmanager"/>
    </system-properties>
  </server>
...
</servers>
...
#jmx_exporter_conf.yaml
rules:
  - pattern: '.*'

Full java command with options

/usr/lib/jvm/java-17-openjdk-amd64/bin/java "-D[Server:server-jvm01]" "-D[pcid:117286201]" -Xms2g -Xmx2g -XX:MaxMetaspaceSize=1g -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -Xbootclasspath/a:/opt/JBOSS80/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.19.jar -Xbootclasspath/a:/opt/JBOSS80/modules/system/layers/base/org/wildfly/common/main/wildfly-common-1.6.0.jar -javaagent:/opt/JBOSS80/bin/jmx_prometheus_javaagent.jar=7071:/opt/JBOSS80/bin/jmx_exporter_conf.yaml -XX:MaxMetaspaceSize=1g -Denv.profiles.active=test -Dinfinispan.stagger.delay=0 -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.security.manager=allow -Djboss.domain.primary.address=jbossprim -Djboss.home.dir=/opt/JBOSS80 "-Djdk.serialFilter=maxbytes=10485760;maxdepth=128;maxarray=100000;maxrefs=300000" -Dorg.apache.cxf.logging.enabled=pretty -Duser.timezone=GMT+00:00 --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldaps=ALL-UNNAMED --add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Djboss.server.log.dir=/opt/JBOSS80/domain/servers/server-jvm01/log -Djboss.server.temp.dir=/opt/JBOSS80/domain/servers/server-jvm01/tmp -Djboss.server.data.dir=/opt/JBOSS80/domain/servers/server-jvm01/data -Dlogging.configuration=file:/opt/JBOSS80/domain/servers/server-jvm01/data/logging.properties -jar /opt/JBOSS80/jboss-modules.jar -mp /opt/JBOSS80/modules org.jboss.as.server

(When I use -Djmx.prometheus.exporter.developer.debug=true no any debug level log and show the same as below)

This is error logs from JBoss(HOST) EAP 8.0
domain.sh: 07:03:34,629 INFO  [org.jboss.as.process.Server:server-jvm01.system.stdout] (stdout for Server:server-jvm01) [Server:server-jvm01] 2024-12-20 14:03:34.625 | main | INFO | io.prometheus.jmx.JavaAgent | Starting ...
domain.sh: 07:03:34,791 ERROR [org.jboss.as.process.Server:server-jvm01.system.stderr] (stderr for Server:server-jvm01) [Server:server-jvm01] Dec 20, 2024 2:03:34 PM java.lang.System$LoggerFinder lambda$accessProvider$0
domain.sh: 07:03:34,792 ERROR [org.jboss.as.process.Server:server-jvm01.system.stderr] (stderr for Server:server-jvm01) [Server:server-jvm01] WARNING: Failed to instantiate LoggerFinder provider; Using default.
domain.sh: 07:03:34,864 INFO  [org.jboss.as.process.Server:server-jvm01.system.stdout] (stdout for Server:server-jvm01) [Server:server-jvm01] 2024-12-20 14:03:34.864 | main | INFO | io.prometheus.jmx.JavaAgent | HTTP enabled [true]
domain.sh: 07:03:34,865 INFO  [org.jboss.as.process.Server:server-jvm01.system.stdout] (stdout for Server:server-jvm01) [Server:server-jvm01] 2024-12-20 14:03:34.864 | main | INFO | io.prometheus.jmx.JavaAgent | HTTP host:port [0.0.0.0:7071]
domain.sh: 07:03:34,865 INFO  [org.jboss.as.process.Server:server-jvm01.system.stdout] (stdout for Server:server-jvm01) [Server:server-jvm01] 2024-12-20 14:03:34.865 | main | INFO | io.prometheus.jmx.JavaAgent | OpenTelemetry enabled [false]
domain.sh: 07:03:34,893 INFO  [org.jboss.as.process.Server:server-jvm01.system.stdout] (stdout for Server:server-jvm01) [Server:server-jvm01] 2024-12-20 14:03:34.892 | main | INFO | io.prometheus.jmx.JavaAgent | Running ...
domain.sh: [Server:server-jvm01] Exception in thread "main" java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
domain.sh: [Server:server-jvm01]         at org.jboss.logmanager.Logger.getLogger(Logger.java:57)
domain.sh: [Server:server-jvm01]         at [email protected]//org.jboss.as.server.DomainServerMain.main(DomainServerMain.java:117)
domain.sh: [Server:server-jvm01]         at org.jboss.modules.Module.run(Module.java:346)
domain.sh: [Server:server-jvm01]         at org.jboss.modules.Module.run(Module.java:314)
domain.sh: [Server:server-jvm01]         at org.jboss.modules.Main.main(Main.java:603)
domain.sh: 07:03:35,519 INFO  [org.jboss.as.process.Server:server-jvm01.status] (reaper for Server:server-jvm01) WFLYPC0011: Process 'Server:server-jvm01' finished with an exit status of 1

When comment the line
<option value="-javaagent:${jboss.home.dir}/bin/jmx_prometheus_javaagent.jar=7071:${jboss.home.dir}/bin/jmx_exporter_conf.yaml"/>
and keep other options, there is no any error show.

BUT in standalone mode with the same java options can works fine
Server: Ubuntu 24.04
Ram: 16 GB
CPU: 4 cores
jmx_exporter version: 1.1.0 (latest)

@suraw00t
Copy link
Author

I just add system property <property name="sun.util.logging.disableCallerCheck" value="true"/> it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant