question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JBOSS (EAP 7.1.0) JMX Attributes disappear while running jmxtrans-agent

See original GitHub issue

I am kicking the tires on JMXTrans-agent and so far it works well for normal JVM stats collection (heap, threads, etc) monitoring for a JBOSS EAP 7.1.0 instance.

I have now tried to add in simple attribute data collection for a JBOSS datasource/pool. JBOSS seems configured correctly, as when I run JMC or VisualVM (local to jboss process) I can navigate to mbeans and interrogate attributes and so on. Here is the problem(s):

When I ‘turn-on’ JMXTrans-agent; all the jboss specific mbeans disappear from JMC/VisualVM; vanilla JVM level stuff is still there. Ok, no problem, maybe that is how JMXTrans-agent works: I’ll turn it off, get the MBEAN names I need from JMC; put that in my jmxtrans-agent.xml and re-enable JMXTrans-agent.

Well that didn’t work as JMXTrans-agent wasn’t spitting out any data for the jboss mbeans. So I found this switch -Dorg.jmxtrans.agent.JmxTransAgent.diagnostic=true. I restarted with that in place and then I found out that ManagementFactory.getPlatformMBeanServer().queryMBeans(null, null) was not including the root mbeans I was interested in – just like when using JMC/VisualVM couldn’t see the mbeans while JMXTrans-agent was active.

It is like when I run JMXTrans-agent; all the jboss specific mbeans are gone!

Is there anything I can do about this?

NOTE: I have tried this same thing on jboss-eap 7.0.8 and jboss-eap-6.4.18 and they have same exact behavior. I haven’t tried any of the wildflys yet; but EAP’s 7x and Wildflys >8 are really really similar; I’d suspect Wildfly 10x and 11x to behave the same.

To turn-on JMXTrans-agent; I do:

export JAVA_OPTS="-Xbootclasspath/p:/opt/jboss-eap-7.1.0/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.0.7.Final-redhat-1.jar -Djava.util.logging.manager=org.jboss.logmanager.LogManager  -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager -Dorg.jmxtrans.agent.JmxTransAgent.diagnostic=true  -javaagent:/opt/jmxtrans-agent-1.2.8-SNAPSHOT.jar=/opt/jmxtrans-agent.xml"

/opt/jboss-eap-7.1.0/bin/standalone.sh -b=blah.blah.com   --debug

My jmxtrans-agent.xml looks like:

<jmxtrans-agent>
    <queries>

<!-- OS 
        <query objectName="java.lang:type=OperatingSystem" attribute="SystemLoadAverage" resultAlias="os.systemLoadAverage"/>

-->
        <!-- JVM -->
        <query objectName="java.lang:type=Memory" attribute="HeapMemoryUsage" key="used" resultAlias="toad"/>
        <query objectName="java.lang:type=Memory" attribute="HeapMemoryUsage" key="committed" resultAlias="jvm.heapMemoryUsage.committed"/>
        <query objectName="java.lang:type=Memory" attribute="NonHeapMemoryUsage" key="used" resultAlias="jvm.nonHeapMemoryUsage.used"/>
        <query objectName="java.lang:type=Memory" attribute="NonHeapMemoryUsage" key="committed" resultAlias="jvm.nonHeapMemoryUsage.committed"/>
        <query objectName="java.lang:type=ClassLoading" attribute="LoadedClassCount" resultAlias="jvm.loadedClasses"/>
        <query objectName="java.lang:type=Threading" attribute="ThreadCount" resultAlias="jvm.thread"/>
<!--
        <query objectName="jboss.as.datasources.OracleDS.pool" attribute="ActiveCount" resultAlias="Active.Pool.Count"/>

attribute="MaxUsedCount" resultAlias="MaxUsedCount"

-->
        <query objectName="jboss.as:subsystem=datasources,xa-data-source=OracleDS,statistics=pool" attribute="MaxUsedCount" />
        <query objectName="jboss.as:subsystem=datasources,xa-data-source=OracleDS,statistics=pool" attribute="AvailableCount" resultAlias="foo"/>
        <query objectName="jboss.as.expr:xa-data-source=OracleDS,statistics=pool" attribute="AvailableCount" resultAlias="foo"/>
    </queries>


<!--
	<outputWriter class="org.jmxtrans.agent.ConsoleOutputWriter" />
--> 


    <outputWriter class="org.jmxtrans.agent.RollingFileOutputWriter">
	<fileName>/opt/jbossstats.log</fileName>
        <enabled>true</enabled>
        <maxFileSize>500</maxFileSize>
        <maxBackupIndex>4</maxBackupIndex>
	<singleLine>true</singleLine>
    </outputWriter>
    <collectIntervalInSeconds>11</collectIntervalInSeconds>
</jmxtrans-agent>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cyrille-leclerccommented, Jul 19, 2019

@rjhontiveros I like to use the “MBeans Browser” plugin of VisualVM to discover the MBeans of a server or of an application. https://visualvm.github.io/plugins.html

1reaction
fwellandcommented, Jan 10, 2018

+1

You are totally, correct! I am on jmxtrans-agent-1.2.8-SNAPSHOT.jar.

The diagnostic trace, (w/o waitForCustomMBeanServer) would should ‘more’ root mbean names on the 2nd and subsquent dumps; but never the roots ‘jboss.as or jboss.as.expr’; and thus no stats.

Adding in waitForCustomMBeanServer=true caused the 2nd diagnostic trace to start dumping a ton more stuff, including the root ‘jboss.as.*’ and stats seemed to be showing up now.

FURTHER, JMC, with JMXTrans-agent active, will display the mbeans too!

Thanks for pointing this out!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Distributed application on JBoss EAP 7.1 loses
Our Spring MVC project is running on JBoss EAP 7.1 with remote caching to DataGrid 7.2. We have observed occasional instances of Session ......
Read more >
Red Hat JBoss Enterprise Application Platform 7.1
The pool-prefill attribute specifies whether JBoss EAP will prefill the connection pool with the minimum number of connections when JBoss EAP ...
Read more >
jmxtrans - Bountysource
When I 'turn-on' JMXTrans-agent; all the jboss specific mbeans disappear from JMC/VisualVM; vanilla JVM level stuff is still there.
Read more >
Jboss.as mbean missing after enable jmx remote wildfly 9.0.2 ...
When I enable JMX in wildfly the Jboss.as mbean simply disappears and I do not know what to do. Below is the image...
Read more >
Configuring the JBoss agent - IBM
The service URL to connect to the MBean server. For JBoss EAP 6, you specify the URL as KQZ_JMX_JSR160_JSR160_SERVICE_URL = service:jmx:remoting-jmx:// ip:9999 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found