Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (109 sloc) 4.34 KB
# Install:
# This plugin is sometimes bundled with collectd, if not
# you can install with:
#
# apt-get install collectd-java collectd-generic-jmx
#
# If your collectd log shows an error loading java.so, this
# is likely because libjvm.so is in a non-standard location.
# You can fix this by adding:
#
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/jvm/java-7-oracle/jre/lib/amd64/server
#
# to your collectd init file, but pointing to the correct
# library path for your java install. For more information on the topic and
# other workarounds see: https://bugzilla.redhat.com/show_bug.cgi?id=1212151
#
# You need to install the signalfx_types_db on your system and reference it
# in the "TypesDB" entry that appears later on in this configuration file. For example:
# cp signalfx_types_db /usr/share/collectd/java-collectd-plugin/signalfx_types_db
#
# If you get an error message that contains the phrase "class file has wrong version" it is likely
# because your version of java is different than the version of java that collectd was compiled with.
# This is especially true for people running java 6. To resolve this, you need to compile collectd from source on a machine using
# the same setup of java you want, and copy over the .jar files that it generates to the jars inside -Djava.class.path.
#
# If the plugin appears to load but you don't see any metrics, you may need to specify
# a InstancePrefix parameter to give your metrics readable names.
# Documentation:
# https://collectd.org/wiki/index.php/Plugin:Java
# https://collectd.org/wiki/index.php/Plugin:GenericJMX
# https://collectd.org/wiki/index.php/Plugin:GenericJMX/Config
# System modifications:
# Make sure the JVMArg path points to valid jar files. If you do not find
# the generic-jmx jar in the JVMArg path you may need to install the collectd-generic-jmx plugin
# Config file modifications:
# Do not modify the config file, but you **WILL** need another config file that
# points to your java application. See 20-javageneric.conf if you want a
# catch-all config for any java app.
TypesDB "/usr/share/collectd/java-collectd-plugin/signalfx_types_db"
LoadPlugin java
<Plugin java>
JVMArg "-verbose:jni"
JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
<Plugin "GenericJMX">
<MBean "classes">
ObjectName "java.lang:type=ClassLoading"
<Value>
Type "gauge"
InstancePrefix "loaded_classes"
Table false
Attribute "LoadedClassCount"
</Value>
</MBean>
<MBean "garbage_collector">
ObjectName "java.lang:type=GarbageCollector,*"
InstancePrefix "gc-"
InstanceFrom "name"
<Value>
Type "invocations"
Table false
Attribute "CollectionCount"
</Value>
<Value>
Type "total_time_in_ms"
InstancePrefix "collection_time"
Table false
Attribute "CollectionTime"
</Value>
</MBean>
<MBean "memory-heap">
ObjectName "java.lang:type=Memory"
InstancePrefix "memory-heap"
<Value>
Type "jmx_memory"
Table true
Attribute "HeapMemoryUsage"
</Value>
</MBean>
<MBean "memory-nonheap">
ObjectName "java.lang:type=Memory"
InstancePrefix "memory-nonheap"
<Value>
Type "jmx_memory"
Table true
Attribute "NonHeapMemoryUsage"
</Value>
</MBean>
<MBean "memory_pool">
ObjectName "java.lang:type=MemoryPool,*"
InstancePrefix "memory_pool-"
InstanceFrom "name"
<Value>
Type "jmx_memory"
Table true
Attribute "Usage"
</Value>
</MBean>
<MBean "threading">
ObjectName "java.lang:type=Threading"
<Value>
Type "gauge"
Table false
InstancePrefix "jvm.threads.count"
Attribute "ThreadCount"
</Value>
</MBean>
</Plugin>
</Plugin>
You can’t perform that action at this time.