JVM Metrics Producer

The JVM Metrics Producer collects JVM related metrics. It uses java.lang.management.ManagementFactory to get to the underlying managed beans that contain the JVM information.


JVM metrics production is currently only supported in conjunction with an ActorSystem, as telemetry requires this to bootstrap. An ActorSystem needs to be initialized before JVM metrics production can be reported.

Add the JVM Metrics Producer dependency to your build:


libraryDependencies += Cinnamon.library.cinnamonJvmMetricsProducer
dependencies {
    implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-jvm-metrics-producer', version: '2.20.1'


Once the dependency has been added there is no need to do any further configuration. By default all types of JVM metrics collected by the producer will generate metrics. This behavior is possible to override with the settings below:

cinnamon {
  producers += jvm-metrics-producer

  jvm-metrics-producer {

    memory-usage {
      # Enable memory usage metrics
      metrics = on
      # The category name for all memory usage metrics
      category = "memory-usage"

    garbage-collection {
      # Enable garbage collection metrics
      metrics = on
      # The category name for all garbage collection metrics
      category = "garbage-collection"

    class-loading {
      # Enable class loading metrics
      metrics = on
      # The category name for all class loading metrics
      category = "class-loading"

These settings are defined in the reference.conf. You only need to specify any of these settings when you want to override the defaults.

Available Metrics

The following metrics is collected by the JVM Metrics Producer:

  • Heap: committed, init, max, used.
  • Non Heap: committed, init, max, used.
  • Total Heap: committed, init, max, used.
  • Memory Pools: committed, init, max, used, usage (for each memory pool)
  • Garbage Collection: count, duration
  • Classes: loaded, unloaded