LoadPlugin network
LoadPlugin java
LoadPlugin disk
LoadPlugin df
LoadPlugin cpu
LoadPlugin interface

<Plugin "network">
  Server "<IP_ADDRESS_HERE>"
</Plugin>

<Plugin "interface">
  Interface "<NETWORK_INTERFACE_HERE>"
  IgnoreSelected false
</Plugin>

<Plugin "disk">
  Disk "/^[vhs]d[a-f]$/"
  IgnoreSelected false
</Plugin>

<Plugin cpu>
  ReportByCpu true
  ReportByState true
  ValuesPercentage true
</Plugin>

<Plugin df>
  FSType sysfs
  FSType proc
  FSType devtmpfs
  FSType devpts
  FSType tmpfs
  FSType fusectl
  FSType cgroup
  FSType overlay
  FSType debugfs
  FSType pstore
  FSType securityfs
  FSType hugetlbfs
  FSType squashfs
  FSType mqueue
  IgnoreSelected true
  ReportByDevice false
  ReportReserved true
  ValuesAbsolute true
  ValuesPercentage true
  ReportInodes true
</Plugin>

<Plugin "java">
  JVMARG "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/collectd-fast-jmx.jar"

  LoadPlugin "com.e_gineering.collectd.FastJMX"

  <Plugin "FastJMX">
    MaxThreads 256
    CollectInternal true

    <MBean "classes">
      ObjectName "java.lang:type=ClassLoading"

      <Value "LoadedClassCount">
        Type "gauge"
        InstancePrefix "loaded_classes"
        PluginName "JVM"
      </Value>
    </MBean>

    # Time spent by the JVM compiling or optimizing.
    <MBean "compilation">
      ObjectName "java.lang:type=Compilation"

      <Value "TotalCompilationTime">
        Type "total_time_in_ms"
        InstancePrefix "compilation_time"
        PluginName "JVM"
      </Value>
    </MBean>

    # Garbage collector information
    <MBean "garbage_collector">
      ObjectName "java.lang:type=GarbageCollector,*"
      InstancePrefix "gc-"
      InstanceFrom "name"

      <Value "CollectionTime">
        Type "total_time_in_ms"
        InstancePrefix "collection_time"
        PluginName "JVM"
      </Value>
      <Value "CollectionCount">
        Type "counter"
        InstancePrefix "collection_count"
        PluginName "JVM"
      </Value>
    </MBean>

    <MBean "memory_pool">
      ObjectName "java.lang:type=MemoryPool,*"
      InstancePrefix "memory_pool-"
      InstanceFrom "name"
      <Value>
        Type "memory"
        Table true
        Attribute "Usage"
      </Value>
    </MBean>

    <MBean "memory-heap">
      ObjectName "java.lang:type=Memory"
      InstancePrefix "memory-heap"
      <Value>
        Type "memory"
        Table true
        Attribute "HeapMemoryUsage"
      </Value>
    </MBean>
    <MBean "memory-nonheap">
      ObjectName "java.lang:type=Memory"
      InstancePrefix "memory-nonheap"
      <Value>
        Type "memory"
        Table true
        Attribute "NonHeapMemoryUsage"
      </Value>
    </MBean>
    <MBean "thread">
      ObjectName "java.lang:type=Threading"
      InstancePrefix "threading"
      <Value>
        Type "gauge"
        Table false
        Attribute "ThreadCount"
        InstancePrefix "count"
      </Value>
    </MBean>
    <MBean "thread-daemon">
      ObjectName "java.lang:type=Threading"
      InstancePrefix "threading"
      <Value>
        Type "gauge"
        Table false
        Attribute "DaemonThreadCount"
        InstancePrefix "count-daemon"
      </Value>
    </MBean>

    <MBean "jvm_runtime">
      ObjectName "java.lang:type=Runtime"
      <Value>
        Type "counter"
        InstancePrefix "runtime-uptime"
        Table false
        Attribute "Uptime"
      </Value>
    </MBean>

    <MBean "jvm_system">
      ObjectName "java.lang:type=OperatingSystem"
      <Value>
        Type "gauge"
        InstancePrefix "os-open_fd_count"
        Table false
        Attribute "OpenFileDescriptorCount"
      </Value>
      <Value>
        Type "counter"
        InstancePrefix "os-process_cpu_time"
        Table false
        Attribute "ProcessCpuTime"
      </Value>
    </MBean>

    <MBean "jetty_qtp">
      ObjectName "org.eclipse.jetty.util.thread:type=queuedthreadpool,id=0"
      InstancePrefix "jetty_qtp"
      <Value>
        Type "gauge"
        InstancePrefix "busy_threads"
        Table false
        Attribute "busyThreads"
      </Value>
      <Value>
        Type "gauge"
        InstancePrefix "idle_threads"
        Table false
        Attribute "idleThreads"
      </Value>
      <Value>
        Type "gauge"
        InstancePrefix "max_threads"
        Table false
        Attribute "maxThreads"
      </Value>
      <Value>
        Type "gauge"
        InstancePrefix "queue_size"
        Table false
        Attribute "queueSize"
      </Value>
    </MBean>

    # xlrelease metrics
    <MBean "xlr-api-int">
      ObjectName "com.xebialabs.xlrelease.metrics.api.internal:*"
      InstancePrefix "xlr-api-int"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "Sum">
        Type "derive"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-api-v1">
      ObjectName "com.xebialabs.xlrelease.metrics.api.v1:*"
      InstancePrefix "xlr-api-v1"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "Sum">
        Type "derive"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-repo">
      ObjectName "com.xebialabs.xlrelease.metrics.repository:*"
      InstancePrefix "xlr-repo"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "Sum">
        Type "derive"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-repo-jcr">
      ObjectName "com.xebialabs.xlrelease.metrics.repository.jcr:*"
      InstancePrefix "xlr-repo-jcr"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "Sum">
        Type "derive"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-exec">
      ObjectName "com.xebialabs.xlrelease.metrics.executors:*"
      InstancePrefix "xlr-exec"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "Sum">
        Type "derive"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-pool">
      ObjectName "com.xebialabs.xlrelease.metrics.pool.repository:*"
      InstancePrefix "xlr-pool"

      <Value "Value">
        Type "gauge"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>
    <MBean "xlr-handler">
      ObjectName "com.xebialabs.xlrelease.metrics.handler:*"
      InstancePrefix "xlr-handler"

      <Value "Count">
        Type "counter"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
      <Value "95thPercentile">
        Type "gauge"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>

    <MBean "kamon">
      ObjectName "kamon:type=akka-dispatcher,name=*"
      InstancePrefix "kamon"

      <Value "Avg">
        Type "gauge"
        InstanceFrom "name"
        PluginName "XLR"
      </Value>
    </MBean>

    <Connection>
      ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
      User "{{ jmx_username }}"
      Password "{{ jmx_password }}"
      IncludePortInHostname true
      Collect "classes"
      Collect "thread"
      Collect "thread-daemon"
      Collect "compilation"
      Collect "garbage_collector"
      Collect "memory_pool"
      Collect "memory-heap"
      Collect "memory-nonheap"
      Collect "jvm_system"
      Collect "jvm_runtime"
      Collect "jetty_qtp"
      Collect "xlr-api-int"
      Collect "xlr-api-v1"
      Collect "xlr-repo"
      Collect "xlr-repo-jcr"
      Collect "xlr-exec"
      Collect "xlr-pool"
      Collect "xlr-handler"
      Collect "kamon"
      TTL {{ jmx_ttl }}
    </Connection>
  </Plugin>
</Plugin>
