[collectd] GenericJMX enhancement
Jason Stelzer
jason.stelzer at gmail.com
Mon May 14 21:34:15 CEST 2012
We are using the GenericJMX plugin to monitor Tomcat.
This produces directory names like: GenericJMX-"http-apr-7084".
I have a visualization frontend that essentially just walks trees of
rrd files and generates graphs from them. I could translate names
there, but I would rather see the filesystem have 'clean' names.
It might be nice to add a toggle so that you can normalize the names.
Is there a preferred approach to this? Should the collector plugin be
responsible for maintaining a mapping to 'actual' and 'cleaned up'
names? There are other metrics that contain whitespace, brackets,
quotes and other noise.
To this end, I modified GenericJMXConfMBean.java and added 2
configuration properties:
MaskChars is a regex of characters to mask.
ReplacementString is a string to replace the masked characters with.
A sample configuration could look like this:
<Plugin "GenericJMX">
# Memory usage by memory pool.
<MBean "appname_tomcat/memory_pool">
ObjectName "java.lang:type=MemoryPool,*"
InstancePrefix "appname_tomcat-memory_pool-"
InstanceFrom "name"
MaskChars "[ ,\\%\\[\\]\"]"
ReplacementString ""
<Value>
Type "memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
Attribute "Usage"
</Value>
</MBean>
</Plugin>
What this essentially means is the following:
* When you replace substrings, it's expected you do so in a way that
is distinct and stable.
* The stats are sent to the collectd system such that the names are 'clean'.
* If you do not specify these directives, the system behaves as it did before.
Would anyone else find this feature convenient? Would you like me to
submit a patch?
--
J.
More information about the collectd
mailing list