JVM Runtime Telemetry
OpenTelemetry Java agent instrumentation
This instrumentation enables JVM runtime metrics using JMX (Java 8+) and JFR (Java 17+) to monitor classes, CPU, garbage collection, memory, and threads.
- Name:
runtime-telemetry - Scope:
io.opentelemetry.runtime-telemetry - Library: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/runtime-telemetry
Telemetry
When Java17
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
jvm.buffer.count | updowncounter | LONG_SUM | {buffer} | Number of buffers in the pool. |
jvm.buffer.memory.limit | updowncounter | LONG_SUM | By | Measure of total memory capacity of buffers. |
jvm.buffer.memory.used | updowncounter | LONG_SUM | By | Measure of memory used by buffers. |
jvm.class.count | updowncounter | LONG_SUM | {class} | Number of classes currently loaded. |
jvm.class.loaded | counter | LONG_SUM | {class} | Number of classes loaded since JVM start. |
jvm.class.unloaded | counter | LONG_SUM | {class} | Number of classes unloaded since JVM start. |
jvm.cpu.longlock | histogram | HISTOGRAM | s | Long lock times |
jvm.cpu.recent_utilization | gauge | DOUBLE_GAUGE | 1 | Recent CPU utilization for the process as reported by the JVM. |
jvm.gc.duration | histogram | HISTOGRAM | s | Duration of JVM garbage collection actions. |
jvm.memory.allocation | histogram | HISTOGRAM | By | Measure of memory allocations. |
jvm.memory.committed | updowncounter | LONG_SUM | By | Measure of memory committed. |
jvm.memory.init | updowncounter | LONG_SUM | By | Measure of initial memory requested. |
jvm.memory.limit | updowncounter | LONG_SUM | By | Measure of max obtainable memory. |
jvm.memory.used | updowncounter | LONG_SUM | By | Measure of memory used. |
jvm.memory.used_after_last_gc | updowncounter | LONG_SUM | By | Measure of memory used, as measured after the most recent garbage collection event on this pool. |
jvm.system.cpu.utilization | gauge | DOUBLE_GAUGE | 1 | Recent CPU utilization for the whole system as reported by the JVM. |
jvm.thread.count | updowncounter | LONG_SUM | {thread} | Number of executing platform threads. |
| Metric | Attributes |
|---|---|
jvm.buffer.count | jvm.buffer.pool.name (STRING) |
jvm.buffer.memory.limit | jvm.buffer.pool.name (STRING) |
jvm.buffer.memory.used | jvm.buffer.pool.name (STRING) |
jvm.gc.duration | jvm.gc.action (STRING), jvm.gc.name (STRING) |
jvm.memory.allocation | arena (STRING) |
jvm.memory.committed | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.init | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.limit | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.used | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.used_after_last_gc | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.thread.count | jvm.thread.daemon (BOOLEAN) |
When Java21
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
jvm.thread.virtual.pinned | histogram | HISTOGRAM | s | Duration of virtual thread pinning. |
When default
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
jvm.buffer.count | updowncounter | LONG_SUM | {buffer} | Number of buffers in the pool. |
jvm.buffer.memory.limit | updowncounter | LONG_SUM | By | Measure of total memory capacity of buffers. |
jvm.buffer.memory.used | updowncounter | LONG_SUM | By | Measure of memory used by buffers. |
jvm.class.count | updowncounter | LONG_SUM | {class} | Number of classes currently loaded. |
jvm.class.loaded | counter | LONG_SUM | {class} | Number of classes loaded since JVM start. |
jvm.class.unloaded | counter | LONG_SUM | {class} | Number of classes unloaded since JVM start. |
jvm.cpu.count | updowncounter | LONG_SUM | {cpu} | Number of processors available to the Java virtual machine. |
jvm.cpu.recent_utilization | gauge | DOUBLE_GAUGE | 1 | Recent CPU utilization for the process as reported by the JVM. |
jvm.cpu.time | counter | DOUBLE_SUM | s | CPU time used by the process as reported by the JVM. |
jvm.file_descriptor.count | updowncounter | LONG_SUM | {file_descriptor} | Number of open file descriptors as reported by the JVM. |
jvm.file_descriptor.limit | updowncounter | LONG_SUM | {file_descriptor} | Measure of max open file descriptors as reported by the JVM. |
jvm.gc.duration | histogram | HISTOGRAM | s | Duration of JVM garbage collection actions. |
jvm.memory.committed | updowncounter | LONG_SUM | By | Measure of memory committed. |
jvm.memory.init | updowncounter | LONG_SUM | By | Measure of initial memory requested. |
jvm.memory.limit | updowncounter | LONG_SUM | By | Measure of max obtainable memory. |
jvm.memory.used | updowncounter | LONG_SUM | By | Measure of memory used. |
jvm.memory.used_after_last_gc | updowncounter | LONG_SUM | By | Measure of memory used, as measured after the most recent garbage collection event on this pool. |
jvm.system.cpu.load_1m | gauge | DOUBLE_GAUGE | {run_queue_item} | Average CPU load of the whole system for the last minute as reported by the JVM. |
jvm.system.cpu.utilization | gauge | DOUBLE_GAUGE | 1 | Recent CPU utilization for the whole system as reported by the JVM. |
jvm.thread.count | updowncounter | LONG_SUM | {thread} | Number of executing platform threads. |
| Metric | Attributes |
|---|---|
jvm.buffer.count | jvm.buffer.pool.name (STRING) |
jvm.buffer.memory.limit | jvm.buffer.pool.name (STRING) |
jvm.buffer.memory.used | jvm.buffer.pool.name (STRING) |
jvm.gc.duration | jvm.gc.action (STRING), jvm.gc.cause (STRING), jvm.gc.name (STRING) |
jvm.memory.committed | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.init | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.limit | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.used | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.memory.used_after_last_gc | jvm.memory.pool.name (STRING), jvm.memory.type (STRING) |
jvm.thread.count | jvm.thread.daemon (BOOLEAN), jvm.thread.state (STRING) |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
otel.instrumentation.runtime-telemetry.emit-experimental-jfr-metrics | boolean | false | Enables the capture of experimental JFR-based JVM runtime metrics on Java 17+. |
otel.instrumentation.runtime-telemetry.emit-experimental-metrics | boolean | false | Enables the capture of experimental JMX-based JVM runtime metrics. |
otel.instrumentation.runtime-telemetry.experimental.jfr-metrics.excluded | list | Excludes JVM runtime metrics from JFR on Java 17+ using exact names or glob patterns with * and ?. Excluded patterns take precedence over included patterns, including over shorthand and legacy selections. Configuring this property without included selects all metrics except those excluded. | |
otel.instrumentation.runtime-telemetry.experimental.jfr-metrics.included | list | Selects JVM runtime metrics to source from JFR on Java 17+. Supports exact names and glob patterns with * and ?. Configuring either JFR metric selector property activates JFR. Use * to select all metrics. | |
otel.instrumentation.runtime-telemetry.experimental.package-emitter.enabled | boolean | false | Enables creating events for JAR libraries used by the application. |
otel.instrumentation.runtime-telemetry.experimental.package-emitter.jars-per-second | int | 10 | The number of JAR files processed per second by the package emitter. |
otel.instrumentation.runtime-telemetry.experimental.prefer-jfr | boolean | false | Deprecated: use otel.instrumentation.runtime-telemetry.experimental.jfr-metrics.included instead. Prefer JFR over JMX for metrics available from both sources, on Java 17+. |