[collectd] JVM statistics collection?

Stephen Hillier shillier at halogensoftware.com
Thu Sep 11 18:21:10 CEST 2008

Thanks for your reply. Most interesting.


I too am tailoring a collection package that's highly customized to my
own systems and needs. And I too seem to have run into a similar problem
as you.


My first attempt at this was to integrate a reworked copy of my already
existing metrics gathering script with the exec plugin, however there
are some serious performance issues related to spawning a JVM to invoke
the java based JMX client to query specific mBeans for attribute values.


I am trying to figure out how best to solve this performance issue, but
that would require a JMX client that doesn 't run inside a JVM. The only
real solution I see is to code up a JMX client in C. I can imagine many
people would have a use for that, but I don't see any such clients in
existence when I went searching for one. 


I was hoping maybe someone else had already started such a project and I
might be able to contribute.  I don't have a great deal of time to
devote to such a project, so we'll see how much work is involved after I
finish my research and mock up a proto-type. 


We'll see where this leads...






From: Brian Long [mailto:brian at dotspots.com] 
Sent: Thursday, September 11, 2008 1:59 AM
To: Stephen Hillier
Cc: collectd at verplant.org
Subject: Re: [collectd] JVM statistics collection?


Hi Steve,


I've integrated collectd with JMX in our systems. We use it to poll the
JVM as well as any other relevant metrics we want from our applications.


What I ended up doing was creating a MonitoredResource and
MonitoredAttribute annotation (similar to ManagedResource and
ManagedAttribute) which can be applied to any bean and getter. Then I
have a MonitoredAnnotationBeanPostProcessor which registers all beans
and their attributes which wish to be monitored. A MonitoringAgent bean
is constructed which emits a single JMX operation, getMonitoredBeans.
This returns a collection of object names and attributes which have been
decorated by the Monitored* annotations and registered via the post
processor. (And since there are no beans to annotate for JVM metrics, I
just hand-register all the interesting JVM objects/attributes in


I have a bridge process with is invoked by the exec plugin which
connects to an app and retrieves all monitored beans by invoking
getMonitoredBeans (via JMX obviously). It proceeds to then retrieve all
the monitored attributes by retrieving each attribute for each object
name emitted in getMonitoredBeans. The bridge is responsible for turning
object names and attributes into plugin/type/instance/data source labels
that are posted by PUTVAL.


Everything about this works fine... the only thing we had to revisit was
launching the bridge app at every iteration. We eventually turned it
into a long-running process which never exits, just to avoid the
overhead of bringing up a new JVM each time.


This is obviously very specific to a system which is based around
Spring, but I found it very simple to emit new metrics this way - all
you need to do is apply the annotations and everything works completely




On Wed, Sep 10, 2008 at 5:59 AM, steve hillier
<shillier at halogensoftware.com> wrote:


       I've read through the docs and faq, and done a few test builds
       source, but did not find any answers to my question(s).

       I'm prototyping a statistics collection package that includes
       network, and JVM statistics collection. I see that collectd can
       do most
       of what I want already (great!), but I don't see anything that
       point towards someone else having used it to gather JVM

       I'm not averse to writing my own plugin, but I don't want to
       the wheel either, so my question is: Has anyone ever tried to
       JVM statistics collection, specifically via JMX or some such

       If not, what barriers might I encounter trying to code up a
       plugin to
       add this functionality?


collectd mailing list
collectd at verplant.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20080911/6e840946/attachment.htm 

More information about the collectd mailing list