-
Notifications
You must be signed in to change notification settings - Fork 38
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
Use of patterns in mbean parameter name doesn't work #3
Comments
Confirmed a) the code needs to be patched to detect when a pattern has been supplied b) it also needs to detect when attributes come and go dynamically at runtime |
When a pattern is specified in the configuration file, for example <mbean name="*:type=Memory" pname="Memory">
<attribute name="HeapMemoryUsage">
<composite name="init" pname="Heap_init" type="int32" units="bytes"/>
<composite name="committed" pname="Heap_committed" type="int32" units="bytes"/>
<composite name="used" pname="Heap_used" type="int32" units="bytes" />
<composite name="max" pname="Heap_max" type="int32" units="bytes" />
</attribute>
</mbean> will match the attribute |
Object o = mbs.getAttribute(objectName, attributeName); This means that we cannot naively use the pattern ObjectName. One way to do this is to list all MBeans using |
There is one further aspect to this - we probably need to support regex "groups" in the pattern and then extract the string in the group and use it to create the metric names sent to Ganglia. |
One way of doing so is (in pseudo code)
|
There are two possible places we can translate the patterns to actual object names, when reading in the XML configuration (1), or just before publishing (2). (1) will mean that the reading of XML depends on a MBeanServer. If we do this, we can make use of this dependency to discard bad configurations, e.g. MBeans that we cannot access, or do not exist (2) will require us to do the checking of pattern names and testing the patterns again all available MBeans in the publish method, which seems to be beyond the responsibility of MBeanAttribute. I will make a new branch to pursue (1) and see how it fares. |
Hello according to http://docs.oracle.com/javase/7/docs/api/javax/management/ObjectName.html
it is possible to use patterns in the objectName.
If I use a pattern in the mbean parameter. f.i.
name="org.eclipse.jetty.server:type=connectorstatistics,*"
Then Jmxetric doesn't collect the counters
The text was updated successfully, but these errors were encountered: