This document describes instruments and attributes for common OS process level
metrics in OpenTelemetry. Also consider the general metric semantic
conventions when creating
instruments not explicitly defined in this document. OS process metrics are
not related to the runtime environment of the program, and should take
measurements from the operating system. For runtime environment metrics see
semantic conventions for runtime environment
metrics.
Warning Existing instrumentations and collector that are using
v1.21.0 of this document
(or prior):
SHOULD NOT adopt any breaking changes from document until the system
semantic conventions are marked stable. Conventions include, but are not
limited to, attributes, metric names, and unit of measure.
SHOULD introduce a control mechanism to allow users to opt-in to the new
conventions once the migration plan is finalized.
Total CPU seconds broken down by different states.
Attribute
Type
Description
Examples
Requirement Level
process.cpu.state
string
The CPU state for this data point. A process SHOULD be characterized either by data points with no state labels, or only data points with state labels.
system
Recommended
process.cpu.state 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.
Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.
Attribute
Type
Description
Examples
Requirement Level
process.cpu.state
string
The CPU state for this data point. A process SHOULD be characterized either by data points with no state labels, or only data points with state labels.
system
Recommended
process.cpu.state 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.
Number of times the process has been context switched.
Attribute
Type
Description
Examples
Requirement Level
process.context_switch_type
string
Specifies whether the context switches for this data point were voluntary or involuntary.
voluntary
Recommended
process.context_switch_type 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.
The type of page fault for this data point. Type major is for major/hard page faults, and minor is for minor/soft page faults.
major
Recommended
process.paging.fault_type 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.