Skip to content

Instantly share code, notes, and snippets.

@jbehrends
Last active December 19, 2015 16:48
Show Gist options
  • Save jbehrends/5986423 to your computer and use it in GitHub Desktop.
Save jbehrends/5986423 to your computer and use it in GitHub Desktop.
<LoadPlugin java>
</LoadPlugin>
<Plugin "java">
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 blocks #
################
# Memory usage by memory pool.
<MBean "jvm_memory_pool">
ObjectName "java.lang:type=MemoryPool,*"
InstancePrefix "jvm_memory_pool-"
InstanceFrom "name"
<Value>
Type "memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
Attribute "Usage"
</Value>
</MBean>
# Heap memory usage
<MBean "jvm_memory-heap">
ObjectName "java.lang:type=Memory"
#InstanceFrom ""
InstancePrefix "memory-heap"
# Creates four values: committed, init, max, used
<Value>
Type "memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
Attribute "HeapMemoryUsage"
</Value>
</MBean>
# Non-heap memory usage
<MBean "jvm_memory_nonheap">
ObjectName "java.lang:type=Memory"
#InstanceFrom ""
InstancePrefix "memory-nonheap"
# Creates four values: committed, init, max, used
<Value>
Type "memory"
#InstancePrefix ""
#InstanceFrom ""
Table true
Attribute "NonHeapMemoryUsage"
</Value>
</MBean>
# Jvm thread count
<MBean "jvm_threads">
ObjectName "java.lang:type=Threading"
#InstanceFrom ""
InstancePrefix "jvm_thread_count"
<Value>
Type "threads"
Attribute "ThreadCount"
</Value>
</MBean>
# Number of classes loaded.
<MBean "jvm_classes">
ObjectName "java.lang:type=ClassLoading"
InstancePrefix "jvm_loaded_classes"
#InstanceFrom ""
<Value>
Type "gauge"
InstancePrefix "loaded_classes"
#InstanceFrom ""
Table false
Attribute "LoadedClassCount"
</Value>
</MBean>
# Garbage collector stats
<MBean "jvm_garbage_collector">
ObjectName "java.lang:type=GarbageCollector,*"
InstancePrefix "jvm_gc-"
InstanceFrom "name"
<Value>
Type "invocations"
InstancePrefix "collection_count"
#InstanceFrom ""
Table false
Attribute "CollectionCount"
</Value>
<Value>
Type "total_time_in_ms"
InstancePrefix "collection_time"
#InstanceFrom ""
Table false
Attribute "CollectionTime"
</Value>
</MBean>
# JVM uptime
<MBean "jvm_uptime">
ObjectName "java.lang:type=Runtime"
InstancePrefix "jvm_uptime"
<Value>
Type "uptime"
Attribute "Uptime"
</Value>
</MBean>
# Cassandra specific MBeans
# org.apache.cassandra.internal metrics
<MBean "cas_internal">
ObjectName "org.apache.cassandra.internal:type=*"
#InstancePrefix ""
InstanceFrom "type"
<Value>
Type "gauge"
Attribute "ActiveCount"
InstancePrefix "activecount"
</Value>
<Value>
Type "gauge"
Attribute "CompletedTasks"
InstancePrefix "completedtasks"
</Value>
<Value>
Type "gauge"
Attribute "CurrentlyBlockedTasks"
InstancePrefix "currentlyblockedtasks"
</Value>
<Value>
Type "gauge"
Attribute "PendingTasks"
InstancePrefix "pendingtasks"
</Value>
<Value>
Type "gauge"
Attribute "TotalBlockedTasks"
InstancePrefix "totalblockedtasks"
</Value>
</MBean>
# org.apache.cassandra.metrics metrics
<MBean "cas_metrics">
ObjectName "org.apache.cassandra.metrics:type=ClientRequestMetrics,name=*"
#InstancePrefix ""
InstanceFrom "name"
<Value>
Type "gauge"
Attribute "Count"
InstancePrefix "count"
</Value>
</MBean>
<MBean "cas_storageservice">
ObjectName "org.apache.cassandra.db:type=StorageService"
#InstancePrefix ""
InstanceFrom "type"
<Value>
Type "gauge"
Attribute "Load"
InstancePrefix "load"
</Value>
</MBean>
<MBean "cas_cf_stats">
ObjectName "org.apache.cassandra.db:type=ColumnFamilies,keyspace=*,columnfamily=*"
InstancePrefix "CF-"
InstanceFrom "columnfamily"
<Value>
Type "gauge"
Attribute "BloomFilterDiskSpaceUsed"
InstancePrefix "bloomfilterdiskspaceused"
</Value>
<Value>
Type "gauge"
Attribute "BloomFilterFalsePositives"
InstancePrefix "bloomfilterfalsepositives"
</Value>
<Value>
Type "gauge"
Attribute "BloomFilterFalseRatio"
InstancePrefix "bloomfilterfalseratio"
</Value>
<Value>
Type "gauge"
Attribute "CompressionRatio"
InstancePrefix "compressionratio"
</Value>
<Value>
Type "gauge"
Attribute "MaxRowSize"
InstancePrefix "maxrowsize"
</Value>
<Value>
Type "gauge"
Attribute "MeanRowSize"
InstancePrefix "meanrowsize"
</Value>
<Value>
Type "gauge"
Attribute "MinRowSize"
InstancePrefix "minrowsize"
</Value>
<Value>
Type "gauge"
Attribute "ReadCount"
InstancePrefix "readcount"
</Value>
<Value>
Type "gauge"
Attribute "WriteCount"
InstancePrefix "writecount"
</Value>
<Value>
Type "gauge"
Attribute "RecentBloomFilterFalsePositives"
InstancePrefix "recentbloomfilterfalsepositives"
</Value>
<Value>
Type "gauge"
Attribute "RecentBloomFilterFalseRatio"
InstancePrefix "recentbloomfilterfalseratio"
</Value>
<Value>
Type "gauge"
Attribute "RecentReadLatencyMicros"
InstancePrefix "recentreadlatencymicros"
</Value>
<Value>
Type "gauge"
Attribute "TotalReadLatencyMicros"
InstancePrefix "totalreadlatencymicros"
</Value>
<Value>
Type "gauge"
Attribute "RecentWriteLatencyMicros"
InstancePrefix "recentwritelatencymicros"
</Value>
<Value>
Type "gauge"
Attribute "TotalWriteLatencyMicros"
InstancePrefix "totalwritelatencymicros"
</Value>
</MBean>
<MBean "cas_compaction_stats">
ObjectName "org.apache.cassandra.db:type=CompactionManager"
InstancePrefix "CompactionManager"
#InstanceFrom ""
<Value>
Type "gauge"
Attribute "CompletedTasks"
InstancePrefix "completedtasks"
</Value>
<Value>
Type "gauge"
Attribute "PendingTasks"
InstancePrefix "pendingtasks"
</Value>
<Value>
Type "gauge"
Attribute "TotalCompactionsCompleted"
InstancePrefix "totalcompactionscompleted"
</Value>
<Value>
Type "gauge"
Attribute "TotalBytesCompacted"
InstancePrefix "totalbytescompacted"
</Value>
</MBean>
#######################
# Connection block(s) #
#######################
<Connection>
Host "<%= @hostname %>"
InstancePrefix "CAS-"
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi"
Collect "jvm_memory_pool"
Collect "jvm_memory-heap"
Collect "jvm_memory_nonheap"
Collect "jvm_threads"
Collect "jvm_classes"
Collect "jvm_garbage_collector"
Collect "jvm_uptime"
Collect "cas_internal"
Collect "cas_metrics"
Collect "cas_storageservice"
Collect "cas_cf_stats"
Collect "cas_compaction_stats"
</Connection>
<Connection>
Host "<%= @hostname %>"
InstancePrefix "AMQ-"
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
Collect "jvm_memory_pool"
Collect "jvm_memory-heap"
Collect "jvm_memory_nonheap"
Collect "jvm_threads"
Collect "jvm_classes"
Collect "jvm_garbage_collector"
Collect "jvm_uptime"
</Connection>
</Plugin>
</Plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment