This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/oshi-5.0.md.

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

MetricInstrumentTypeUnitDescription
system.disk.iocounterLONG_SUMByDisk bytes transferred.
system.disk.operationscounterLONG_SUM{operation}Disk operations count.
system.memory.usageupdowncounterLONG_SUMByReports memory in use by state.
system.memory.utilizationgaugeDOUBLE_GAUGE1Percentage of memory bytes in use.
system.network.errorscounterLONG_SUM{error}Count of network errors detected.
system.network.iocounterLONG_SUMByThe number of bytes transmitted and received.
system.network.packet.countcounterLONG_SUM{packet}The number of packets transferred.
MetricAttributes
system.disk.iodisk.io.direction (STRING), system.device (STRING)
system.disk.operationsdisk.io.direction (STRING), system.device (STRING)
system.memory.usagesystem.memory.state (STRING)
system.memory.utilizationsystem.memory.state (STRING)
system.network.errorsnetwork.interface.name (STRING), network.io.direction (STRING)
system.network.ionetwork.interface.name (STRING), network.io.direction (STRING)
system.network.packet.countnetwork.io.direction (STRING), system.device (STRING)

When otel.instrumentation.common.v3-preview=true,otel.instrumentation.oshi.experimental-metrics.enabled=true

Metrics

MetricInstrumentTypeUnitDescription
system.disk.iocounterLONG_SUMByDisk bytes transferred.
system.disk.operationscounterLONG_SUM{operation}Disk operations count.
system.memory.usageupdowncounterLONG_SUMByReports memory in use by state.
system.memory.utilizationgaugeDOUBLE_GAUGE1Percentage of memory bytes in use.
system.network.errorscounterLONG_SUM{error}Count of network errors detected.
system.network.iocounterLONG_SUMByThe number of bytes transmitted and received.
system.network.packet.countcounterLONG_SUM{packet}The number of packets transferred.
MetricAttributes
system.disk.iodisk.io.direction (STRING), system.device (STRING)
system.disk.operationsdisk.io.direction (STRING), system.device (STRING)
system.memory.usagesystem.memory.state (STRING)
system.memory.utilizationsystem.memory.state (STRING)
system.network.errorsnetwork.interface.name (STRING), network.io.direction (STRING)
system.network.ionetwork.interface.name (STRING), network.io.direction (STRING)
system.network.packet.countnetwork.io.direction (STRING), system.device (STRING)

Configuration

OptionTypeDefaultDescription
otel.instrumentation.oshi.experimental-metrics.enabledbooleanfalseDeprecated. 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.

Data

  • JSON (latest): /data/javaagent/instrumentations/oshi-5.0/latest.json
  • JSON (pinned): /data/javaagent/instrumentations/oshi-5.0/oshi-5.0-9fb0c7a5f4ca.json
  • Explore: /java-agent/instrumentation/oshi-5.0