Skip to content

Files

Latest commit

 

History

History
133 lines (99 loc) · 6.43 KB

cpu-metrics.md

File metadata and controls

133 lines (99 loc) · 6.43 KB

Semantic conventions for CPU metrics

Status: Experimental

This document describes instruments and attributes for common CPU level metrics in OpenTelemetry.

CPU Metrics

Metric: cpu.time

This metric is recommended.

Name Instrument Type Unit (UCUM) Description Stability
cpu.time Counter s Seconds each logical CPU spent on each mode Development
Attribute Type Description Examples Requirement Level Stability
cpu.logical_number int The logical CPU number [0..n-1] 1 Recommended Development
cpu.mode string The mode of the CPU [1] user; system Recommended Development

[1] cpu.mode: Following states SHOULD be used: user, system, nice, idle, iowait, interrupt, steal


cpu.mode has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
idle idle Development
interrupt interrupt Development
iowait iowait Development
kernel kernel Development
nice nice Development
steal steal Development
system system Development
user user Development

Metric: cpu.utilization

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
cpu.utilization Gauge 1 For each logical CPU, the utilization is calculated as the change in cumulative CPU time (cpu.time) over a measurement interval, divided by the elapsed time. Development
Attribute Type Description Examples Requirement Level Stability
cpu.logical_number int The logical CPU number [0..n-1] 1 Recommended Development
cpu.mode string The mode of the CPU [1] user; system Recommended Development

[1] cpu.mode: Following modes SHOULD be used: user, system, nice, idle, iowait, interrupt, steal


cpu.mode has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Value Description Stability
idle idle Development
interrupt interrupt Development
iowait iowait Development
kernel kernel Development
nice nice Development
steal steal Development
system system Development
user user Development

Metric: cpu.frequency

This metric is recommended.

Name Instrument Type Unit (UCUM) Description Stability
cpu.frequency Gauge Hz Operating frequency of the logical CPU in Hertz. Development
Attribute Type Description Examples Requirement Level Stability
cpu.logical_number int The logical CPU number [0..n-1] 1 Recommended Development