OSHI
OpenTelemetry Java agent instrumentation
When the OSHI library is detected on the classpath, this instrumentation enables system metrics for memory, disk, and network operations.
- Name:
oshi-5.0 - Scope:
io.opentelemetry.oshi-5.0 - Target versions:
com.github.oshi:oshi-core:[5.0.0,) - Library: https://github.com/oshi/oshi/
Telemetry
When otel.instrumentation.common.v3-preview=true
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
system.disk.io | counter | LONG_SUM | By | Disk bytes transferred. |
system.disk.operations | counter | LONG_SUM | {operation} | Disk operations count. |
system.memory.usage | updowncounter | LONG_SUM | By | Reports memory in use by state. |
system.memory.utilization | gauge | DOUBLE_GAUGE | 1 | Percentage of memory bytes in use. |
system.network.errors | counter | LONG_SUM | {error} | Count of network errors detected. |
system.network.io | counter | LONG_SUM | By | The number of bytes transmitted and received. |
system.network.packet.count | counter | LONG_SUM | {packet} | The number of packets transferred. |
| Metric | Attributes |
|---|---|
system.disk.io | disk.io.direction (STRING), system.device (STRING) |
system.disk.operations | disk.io.direction (STRING), system.device (STRING) |
system.memory.usage | system.memory.state (STRING) |
system.memory.utilization | system.memory.state (STRING) |
system.network.errors | network.interface.name (STRING), network.io.direction (STRING) |
system.network.io | network.interface.name (STRING), network.io.direction (STRING) |
system.network.packet.count | network.io.direction (STRING), system.device (STRING) |
When otel.instrumentation.common.v3-preview=true,otel.instrumentation.oshi.experimental-metrics.enabled=true
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
system.disk.io | counter | LONG_SUM | By | Disk bytes transferred. |
system.disk.operations | counter | LONG_SUM | {operation} | Disk operations count. |
system.memory.usage | updowncounter | LONG_SUM | By | Reports memory in use by state. |
system.memory.utilization | gauge | DOUBLE_GAUGE | 1 | Percentage of memory bytes in use. |
system.network.errors | counter | LONG_SUM | {error} | Count of network errors detected. |
system.network.io | counter | LONG_SUM | By | The number of bytes transmitted and received. |
system.network.packet.count | counter | LONG_SUM | {packet} | The number of packets transferred. |
| Metric | Attributes |
|---|---|
system.disk.io | disk.io.direction (STRING), system.device (STRING) |
system.disk.operations | disk.io.direction (STRING), system.device (STRING) |
system.memory.usage | system.memory.state (STRING) |
system.memory.utilization | system.memory.state (STRING) |
system.network.errors | network.interface.name (STRING), network.io.direction (STRING) |
system.network.io | network.interface.name (STRING), network.io.direction (STRING) |
system.network.packet.count | network.io.direction (STRING), system.device (STRING) |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
otel.instrumentation.oshi.experimental-metrics.enabled | boolean | false | Deprecated. Outside v3 preview, enables the experimental runtime.java.memory and runtime.java.cpu_time metrics. This setting is ignored when otel.instrumentation.common.v3-preview=true. Will be removed in 3.0. Use the standard JVM metrics jvm.memory.used and jvm.cpu.time instead. These are not exact replacements: jvm.memory.used measures JVM memory pools rather than process RSS or virtual memory, and jvm.cpu.time does not separate user and system CPU time. |