Java Runtime Metrics
Datadog's Research Report: The State of Serverless Report: The State of Serverless

Java Runtime Metrics

Automatic Configuration

JVM metrics collection is enabled by default for Java tracer v0.29.0+. It can be disabled with one configuration parameter in the tracing client, either through a system property, -Ddd.jmxfetch.enabled=false, or through an environment variable, DD_JMXFETCH_ENABLED=false.

JVM metrics can be viewed in correlation with your Java services. See the Service page in Datadog.

By default, runtime metrics from your application are sent to the Datadog Agent with DogStatsD over port 8125. Make sure that DogStatsD is enabled for the Agent.

If you are running the Agent as a container, ensure that DD_DOGSTATSD_NON_LOCAL_TRAFFIC is set to true, and that port 8125 is open on the Agent. Additionally, for:

Notes:

  • For the runtime UI, dd-trace-java >= 0.24.0 is supported.
  • To associate JVM metrics within flame graphs, ensure the env: tag (case-sensitive) is set and matching across your environment.

Data Collected

The following metrics are collected by default after enabling JVM metrics.

jvm.heap_memory
(gauge)
The total Java heap memory used.
Shown as byte
jvm.heap_memory_committed
(gauge)
The total Java heap memory committed to be used.
Shown as byte
jvm.heap_memory_init
(gauge)
The initial Java heap memory allocated.
Shown as byte
jvm.heap_memory_max
(gauge)
The maximum Java heap memory available.
Shown as byte
jvm.non_heap_memory
(gauge)
The total Java non-heap memory used.
Shown as byte
jvm.non_heap_memory_committed
(gauge)
The total Java non-heap memory committed to be used.
Shown as byte
jvm.non_heap_memory_init
(gauge)
The initial Java non-heap memory allocated.
Shown as byte
jvm.non_heap_memory_max
(gauge)
The maximum Java non-heap memory available.
Shown as byte
jvm.thread_count
(count)
The number of live threads.
Shown as thread
jvm.gc.cms.count
(count)
The total number of garbage collections that have occurred.
jvm.gc.major_collection_count
(count)
The number of major garbage collections that have occurred. Set `new_gc_metrics: true` to receive this metric.
jvm.gc.minor_collection_count
(count)
The number of minor garbage collections that have occurred. Set `new_gc_metrics: true` to receive this metric.
jvm.gc.parnew.time
(gauge)
The approximate accumulated garbage collection time elapsed.
Shown as millisecond
jvm.gc.major_collection_time
(gauge)
The approximate major garbage collection time elapsed. Set `new_gc_metrics: true` to receive this metric.
Shown as millisecond
jvm.gc.minor_collection_time
(gauge)
The approximate minor garbage collection time elapsed. Set `new_gc_metrics: true` to receive this metric.
Shown as millisecond

Along with displaying these metrics in your APM Service Page, Datadog provides a default JVM Runtime Dashboard with the service and runtime-id tags that are applied to these metrics.

Additional JMX metrics can be added using configuration files that are passed on using dd.jmxfetch.config.dir and dd.jmxfetch.config. You can also enable existing Datadog JMX integrations individually with the dd.jmxfetch.<INTEGRATION_NAME>.enabled=true parameter. This auto-embeds configuration from Datadog’s existing JMX configuration files. See the JMX Integration for further details on configuration.

Further Reading