Java runtime metrics
APM Java Library version 3.1.0 and later
OTel semantic JVM metrics are collected via the JMX-based runtime-telemetry-java8 and JFR-based runtime-telemetry-java17 instrumentations. The metrics are all prefixed with jvm.*.
runtime-telemetry-java8 is automatically enabled. To enable/disable, set true or false for one of the configuration options:
-
system property
otel.instrumentation.runtime-telemetry.enabled -
environment variable
OTEL_INSTRUMENTATION_RUNTIME_TELEMETRY_ENABLED
runtime-telemetry-java17 is automatically enabled in APM Java library versions 3.1.2 and later. This enables all JfrFeatures and the corresponding metrics, and collects the union of JMX- and JFR-based metrics. To enable/disable, set true or false for one of the configuration options:
-
system property
otel.instrumentation.runtime-telemetry-java17.enable-all -
environment variable
OTEL_INSTRUMENTATION_RUNTIME_TELEMETRY_JAVA17_ENABLE_ALL
Additional configuration details can be found at the main runtime-telemetry README page.
There is also a jmx-metrics instrumentation that can be used to collect and report metrics provided by JMX through local MBeans available within the instrumented application. Collecting and reporting are provided out of the box for jetty, kafka-broker, wildfly, which are in addition to what runtime-telemetry-java8/17 provide; by default none are enabled. For JVM metrics the runtime-telemetry instrumentation is recommended. To enable collection of these metrics, set the following configuration options:
-
Enable JMX metric collections
-
system property
-Dotel.jmx.enabled=true -
environment variable
OTEL_JMX_ENABLED=true
-
-
Enable collections for out of the box supported systems
-
system property
-Dotel.jmx.target.system=jetty,kafka-broker,wildfly -
environment variable
OTEL_JMX_TARGET_SYSTEM=jetty,kafka-broker,wildfly
-
-
Enable collections for other systems based on configuration file
-
system property
-Dotel.jmx.config=path/to/config_file.yaml,more_rules.yaml -
environment variable
OTEL_JMX_CONFIG=path/to/config_file.yaml,more_rules.yaml
-
The first configuration option must be set for the rest to take effect. Please see jmx-metrics for additional information.
APM Java Library versions earlier than 3.1.0
No pre-built dashboard is available for these legacy metrics.
The legacy runtime metrics are gathered from JMX MBeans and reported by the library on an interval. Reporting is enabled by default for the metrics described below. To disable reporting or enable additional JMX metrics, see Java JMX configuration.
-
Legacy
trace.jvm.*is still collected and configurable through config file. More information can be found here on how to configure.
| Metric | Description |
|---|---|
trace.jvm.GarbageCollector.*
|
JVM garbage collection cumulative values, plotted as derivatives in the JMX dashboard. |
trace.jvm.Memory.*
|
Heap and non-heap memory details. |
trace.jvm.MemoryPool.*
|
Memory pool details. A memory pool represents the memory resource managed by the JVM, for example Metaspace (PermGen). |
trace.jvm.OperatingSystem.*
|
Operating system details, such as process CPU load. |
trace.jvm.Runtime.*
|
Java process uptime. |
trace.jvm.Threading.*
|
Thread details, such as thread count. |