jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

Only getting first attribute for java.lang:type=OperatingSystem #139

Open drpauldixon opened 5 years ago

drpauldixon commented 5 years ago

Hello,

I have the following query:

<query objectName="java.lang:type=OperatingSystem" attributes="SystemLoadAverage,OpenFileDescriptorCount" resultAlias="os.#attribute#"/>

However, only the first metric is output:

$ sudo  ngrep -d any -W byline port 2003 | grep --line-buffered .os
stats.vagrant.fam01.os.SystemLoadAverage 0.45 1550861424
stats.vagrant.fam01.os.SystemLoadAverage 0.38 1550861434
stats.vagrant.fam01.os.SystemLoadAverage 0.47 1550861444
stats.vagrant.fam01.os.SystemLoadAverage 0.4 1550861454
stats.vagrant.fam01.os.SystemLoadAverage 0.34 1550861464
stats.vagrant.fam01.os.SystemLoadAverage 0.28 1550861474
stats.vagrant.fam01.os.SystemLoadAverage 0.24 1550861484

I've looked through the examples and can't find anything that looks obviously wrong. If I reverse the order of the attributes, I get whatever attribute is first in the list, but not the other(s).

I've tried versions 1.2.6 and 1.2.8 beta 1. I'm using OpenJDK 1.8 on CentOS 7.

drpauldixon commented 5 years ago

If I change the outputWriter to statsd: <outputWriter class="org.jmxtrans.agent.StatsDOutputWriter"> then I do se all the metrics:

$ sudo ngrep -d any -W byline port 8125 | grep --line-buffered .os
stats.vagrant.fam01.os.SystemLoadAverage:1.12|c
stats.vagrant.fam01.os.OpenFileDescriptorCount:113|c