diff --git a/.chloggen/cpu_namespace.yaml b/.chloggen/cpu_namespace.yaml
new file mode 100755
index 000000000..e9f7589db
--- /dev/null
+++ b/.chloggen/cpu_namespace.yaml
@@ -0,0 +1,22 @@
+# Use this changelog template to create an entry for release notes.
+#
+# If your change doesn't affect end users you should instead start
+# your pull request title with [chore] or use the "Skip Changelog" label.
+
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: 'breaking'
+
+# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
+component: system
+
+# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: Move CPU-related system.cpu.* metrics to CPU namespace
+
+# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
+# The values here must be integers.
+issues: [1873]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
diff --git a/docs/attributes-registry/cpu.md b/docs/attributes-registry/cpu.md
index cce224891..9e08dca64 100644
--- a/docs/attributes-registry/cpu.md
+++ b/docs/attributes-registry/cpu.md
@@ -9,6 +9,7 @@ Attributes specific to a cpu instance.
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
+| `cpu.logical_number` | int | The logical CPU number [0..n-1] | `1` |  |
| `cpu.mode` | string | The mode of the CPU | `user`; `system` |  |
---
diff --git a/docs/attributes-registry/system.md b/docs/attributes-registry/system.md
index aa305f2ba..3683243ff 100644
--- a/docs/attributes-registry/system.md
+++ b/docs/attributes-registry/system.md
@@ -4,7 +4,6 @@
# System
- [General System Attributes](#general-system-attributes)
-- [System CPU Attributes](#system-cpu-attributes)
- [Filesystem Attributes](#filesystem-attributes)
- [System Memory Attributes](#system-memory-attributes)
- [System Paging Attributes](#system-paging-attributes)
@@ -19,14 +18,6 @@ Describes System attributes
|---|---|---|---|---|
| `system.device` | string | The device identifier | `(identifier)` |  |
-## System CPU Attributes
-
-Describes System CPU attributes
-
-| Attribute | Type | Description | Examples | Stability |
-|---|---|---|---|---|
-| `system.cpu.logical_number` | int | The logical CPU number [0..n-1] | `1` |  |
-
## Filesystem Attributes
Describes Filesystem attributes
@@ -142,6 +133,7 @@ Deprecated system attributes.
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
+| `system.cpu.logical_number` | int | Deprecated, use `cpu.logical_number` instead. | `1` |  |
| `system.cpu.state` | string | Deprecated, use `cpu.mode` instead. | `idle`; `interrupt` | 
Replaced by `cpu.mode` |
| `system.network.state` | string | Deprecated, use `network.connection.state` instead. | `close_wait` | 
Removed, report network connection state with `network.connection.state` attribute |
| `system.processes.status` | string | Deprecated, use `system.process.status` instead. | `running` | 
Replaced by `system.process.status`. |
diff --git a/docs/system/README.md b/docs/system/README.md
index 24ac1c7c5..a266f5c43 100644
--- a/docs/system/README.md
+++ b/docs/system/README.md
@@ -12,6 +12,7 @@ System semantic conventions are defined for the following metrics:
* [System](system-metrics.md): For standard system metrics.
* [Container](container-metrics.md): For container-related metrics.
+* [CPU](cpu-metrics.md): For CPU-related metrics.
* [K8s](k8s-metrics.md): For K8s-related metrics.
* [Hardware](hardware-metrics.md): For hardware-related metrics.
* [Process](process-metrics.md): For standard process metrics.
diff --git a/docs/system/cpu-metrics.md b/docs/system/cpu-metrics.md
new file mode 100644
index 000000000..e300cb10c
--- /dev/null
+++ b/docs/system/cpu-metrics.md
@@ -0,0 +1,133 @@
+
+
+# Semantic conventions for CPU metrics
+
+**Status**: [Experimental][DocumentStatus]
+
+This document describes instruments and attributes for common CPU level metrics
+in OpenTelemetry.
+
+
+
+- [CPU Metrics](#cpu-metrics)
+ - [Metric: `cpu.time`](#metric-cputime)
+ - [Metric: `cpu.utilization`](#metric-cpuutilization)
+ - [Metric: `cpu.frequency`](#metric-cpufrequency)
+
+
+
+## CPU Metrics
+
+### Metric: `cpu.time`
+
+This metric is [recommended][MetricRecommended].
+
+
+
+
+
+
+
+
+| Name | Instrument Type | Unit (UCUM) | Description | Stability |
+| -------- | --------------- | ----------- | -------------- | --------- |
+| `cpu.time` | Counter | `s` | Seconds each logical CPU spent on each mode |  |
+
+| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
+|---|---|---|---|---|---|
+| [`cpu.logical_number`](/docs/attributes-registry/cpu.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
+| [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The mode of the CPU [1] | `user`; `system` | `Recommended` |  |
+
+**[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 |  |
+| `interrupt` | interrupt |  |
+| `iowait` | iowait |  |
+| `kernel` | kernel |  |
+| `nice` | nice |  |
+| `steal` | steal |  |
+| `system` | system |  |
+| `user` | user |  |
+
+
+
+
+
+
+### Metric: `cpu.utilization`
+
+This metric is [opt-in][MetricOptIn].
+
+
+
+
+
+
+
+
+| 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. |  |
+
+| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
+|---|---|---|---|---|---|
+| [`cpu.logical_number`](/docs/attributes-registry/cpu.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
+| [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The mode of the CPU [1] | `user`; `system` | `Recommended` |  |
+
+**[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 |  |
+| `interrupt` | interrupt |  |
+| `iowait` | iowait |  |
+| `kernel` | kernel |  |
+| `nice` | nice |  |
+| `steal` | steal |  |
+| `system` | system |  |
+| `user` | user |  |
+
+
+
+
+
+
+### Metric: `cpu.frequency`
+
+This metric is [recommended][MetricRecommended].
+
+
+
+
+
+
+
+
+| Name | Instrument Type | Unit (UCUM) | Description | Stability |
+| -------- | --------------- | ----------- | -------------- | --------- |
+| `cpu.frequency` | Gauge | `Hz` | Operating frequency of the logical CPU in Hertz. |  |
+
+| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
+|---|---|---|---|---|---|
+| [`cpu.logical_number`](/docs/attributes-registry/cpu.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
+
+
+
+
+
+
+[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
+[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in
+[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md
index 27e806722..169938b57 100644
--- a/docs/system/system-metrics.md
+++ b/docs/system/system-metrics.md
@@ -22,11 +22,8 @@ Resource attributes related to a host, SHOULD be reported under the `host.*` nam
- [General Metrics](#general-metrics)
- [Metric: `system.uptime`](#metric-systemuptime)
- [Processor Metrics](#processor-metrics)
- - [Metric: `system.cpu.time`](#metric-systemcputime)
- - [Metric: `system.cpu.utilization`](#metric-systemcpuutilization)
- [Metric: `system.cpu.physical.count`](#metric-systemcpuphysicalcount)
- [Metric: `system.cpu.logical.count`](#metric-systemcpulogicalcount)
- - [Metric: `system.cpu.frequency`](#metric-systemcpufrequency)
- [Memory Metrics](#memory-metrics)
- [Metric: `system.memory.usage`](#metric-systemmemoryusage)
- [Metric: `system.memory.limit`](#metric-systemmemorylimit)
@@ -102,90 +99,6 @@ The actual accuracy would depend on the instrumentation and operating system.
**Description:** System level processor metrics captured under the namespace `system.cpu`.
-### Metric: `system.cpu.time`
-
-This metric is [recommended][MetricRecommended].
-
-
-
-
-
-
-
-
-| Name | Instrument Type | Unit (UCUM) | Description | Stability |
-| -------- | --------------- | ----------- | -------------- | --------- |
-| `system.cpu.time` | Counter | `s` | Seconds each logical CPU spent on each mode |  |
-
-| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
-|---|---|---|---|---|---|
-| [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The CPU mode for this data point. A system's CPU SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels. [1] | `user`; `system` | `Recommended` |  |
-| [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
-
-**[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 |  |
-| `interrupt` | interrupt |  |
-| `iowait` | iowait |  |
-| `kernel` | kernel |  |
-| `nice` | nice |  |
-| `steal` | steal |  |
-| `system` | system |  |
-| `user` | user |  |
-
-
-
-
-
-
-### Metric: `system.cpu.utilization`
-
-This metric is [opt-in][MetricOptIn].
-
-
-
-
-
-
-
-
-| Name | Instrument Type | Unit (UCUM) | Description | Stability |
-| -------- | --------------- | ----------- | -------------- | --------- |
-| `system.cpu.utilization` | Gauge | `1` | Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs |  |
-
-| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
-|---|---|---|---|---|---|
-| [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The CPU mode for this data point. A system's CPU SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels. [1] | `user`; `system` | `Recommended` |  |
-| [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
-
-**[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 |  |
-| `interrupt` | interrupt |  |
-| `iowait` | iowait |  |
-| `kernel` | kernel |  |
-| `nice` | nice |  |
-| `steal` | steal |  |
-| `system` | system |  |
-| `user` | user |  |
-
-
-
-
-
-
### Metric: `system.cpu.physical.count`
This metric is [recommended][MetricRecommended].
@@ -230,30 +143,6 @@ This metric is [recommended][MetricRecommended].
-### Metric: `system.cpu.frequency`
-
-This metric is [recommended][MetricRecommended].
-
-
-
-
-
-
-
-
-| Name | Instrument Type | Unit (UCUM) | Description | Stability |
-| -------- | --------------- | ----------- | -------------- | --------- |
-| `system.cpu.frequency` | Gauge | `{Hz}` | Reports the current frequency of the CPU in Hz |  |
-
-| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
-|---|---|---|---|---|---|
-| [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` |  |
-
-
-
-
-
-
## Memory Metrics
**Description:** System level memory metrics capture under the namespace `system.memory`.
diff --git a/model/cpu/metrics.yaml b/model/cpu/metrics.yaml
new file mode 100644
index 000000000..8819d4099
--- /dev/null
+++ b/model/cpu/metrics.yaml
@@ -0,0 +1,35 @@
+groups:
+ # cpu.* metrics
+ - id: metric.cpu.time
+ type: metric
+ metric_name: cpu.time
+ stability: development
+ brief: "Seconds each logical CPU spent on each mode"
+ instrument: counter
+ unit: "s"
+ attributes:
+ - ref: cpu.mode
+ note: "Following states SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
+ - ref: cpu.logical_number
+
+ - id: metric.cpu.utilization
+ type: metric
+ metric_name: cpu.utilization
+ stability: development
+ brief: "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."
+ instrument: gauge
+ unit: "1"
+ attributes:
+ - ref: cpu.mode
+ note: "Following modes SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
+ - ref: cpu.logical_number
+
+ - id: metric.cpu.frequency
+ type: metric
+ metric_name: cpu.frequency
+ stability: development
+ brief: "Operating frequency of the logical CPU in Hertz."
+ instrument: gauge
+ unit: "Hz"
+ attributes:
+ - ref: cpu.logical_number
diff --git a/model/cpu/registry.yaml b/model/cpu/registry.yaml
index fa6b43076..73613f78d 100644
--- a/model/cpu/registry.yaml
+++ b/model/cpu/registry.yaml
@@ -35,3 +35,8 @@ groups:
stability: development
stability: development
examples: [ "user", "system" ]
+ - id: cpu.logical_number
+ type: int
+ stability: development
+ brief: "The logical CPU number [0..n-1]"
+ examples: [1]
diff --git a/model/system/deprecated/metrics-deprecated.yaml b/model/system/deprecated/metrics-deprecated.yaml
new file mode 100644
index 000000000..43f131229
--- /dev/null
+++ b/model/system/deprecated/metrics-deprecated.yaml
@@ -0,0 +1,27 @@
+groups:
+ - id: metric.system.cpu.time
+ type: metric
+ metric_name: system.cpu.time
+ brief: "Deprecated. Use `cpu.time` instead."
+ deprecated: "Replaced by `cpu.time`."
+ stability: experimental
+ instrument: counter
+ unit: "s"
+
+ - id: metric.system.cpu.utilization
+ type: metric
+ metric_name: system.cpu.utilization
+ brief: "Deprecated. Use `cpu.utilization` instead."
+ deprecated: "Replaced by `cpu.utilization`."
+ stability: experimental
+ instrument: gauge
+ unit: "1"
+
+ - id: metric.system.cpu.frequency
+ type: metric
+ metric_name: system.cpu.frequency
+ brief: "Deprecated. Use `cpu.frequency` instead."
+ deprecated: "Replaced by `cpu.frequency`."
+ stability: experimental
+ instrument: gauge
+ unit: "{Hz}"
diff --git a/model/system/deprecated/registry-deprecated.yaml b/model/system/deprecated/registry-deprecated.yaml
index 0cbb31294..c24aaf27d 100644
--- a/model/system/deprecated/registry-deprecated.yaml
+++ b/model/system/deprecated/registry-deprecated.yaml
@@ -94,3 +94,8 @@ groups:
stability: development
brief: "Deprecated, use `network.connection.state` instead."
examples: [ "close_wait" ]
+ - id: system.cpu.logical_number
+ type: int
+ stability: experimental
+ brief: "Deprecated, use `cpu.logical_number` instead."
+ examples: [1]
diff --git a/model/system/metrics.yaml b/model/system/metrics.yaml
index 8522bdf2a..a0222e39c 100644
--- a/model/system/metrics.yaml
+++ b/model/system/metrics.yaml
@@ -12,42 +12,6 @@ groups:
unit: "s"
# system.cpu.* metrics
- - id: metric.system.cpu.time
- type: metric
- metric_name: system.cpu.time
- stability: development
- brief: "Seconds each logical CPU spent on each mode"
- instrument: counter
- unit: "s"
- attributes:
- - ref: cpu.mode
- brief: "The CPU mode for this data point. A system's CPU SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels."
- note: "Following states SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
- - ref: system.cpu.logical_number
-
- - id: metric.system.cpu.utilization
- type: metric
- metric_name: system.cpu.utilization
- stability: development
- brief: "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
- instrument: gauge
- unit: "1"
- attributes:
- - ref: cpu.mode
- brief: "The CPU mode for this data point. A system's CPU SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels."
- note: "Following modes SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
- - ref: system.cpu.logical_number
-
- - id: metric.system.cpu.frequency
- type: metric
- metric_name: system.cpu.frequency
- stability: development
- brief: "Reports the current frequency of the CPU in Hz"
- instrument: gauge
- unit: "{Hz}"
- attributes:
- - ref: system.cpu.logical_number
-
- id: metric.system.cpu.physical.count
type: metric
metric_name: system.cpu.physical.count
@@ -193,12 +157,12 @@ groups:
instrument: counter
unit: "s"
note: |
- The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as:
+ The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as:
- - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats)
- - Windows: The complement of
- ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained)
- performance counter: `uptime * (100 - "Disk\% Idle Time") / 100`
+ - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats)
+ - Windows: The complement of
+ ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained)
+ performance counter: `uptime * (100 - "Disk\% Idle Time") / 100`
attributes:
- ref: system.device
@@ -210,10 +174,10 @@ groups:
instrument: counter
unit: "s"
note: |
- Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as:
+ Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as:
- - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats)
- - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes)
+ - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats)
+ - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes)
attributes:
- ref: system.device
- ref: disk.io.direction
diff --git a/model/system/registry.yaml b/model/system/registry.yaml
index 13101ee91..5f1cdf0d7 100644
--- a/model/system/registry.yaml
+++ b/model/system/registry.yaml
@@ -10,17 +10,6 @@ groups:
stability: development
brief: "The device identifier"
examples: ["(identifier)"]
- # system.cpu.* attribute group
- - id: registry.system.cpu
- type: attribute_group
- display_name: System CPU Attributes
- brief: "Describes System CPU attributes"
- attributes:
- - id: system.cpu.logical_number
- type: int
- stability: development
- brief: "The logical CPU number [0..n-1]"
- examples: [1]
# system.memory.* attribute group
- id: registry.system.memory
type: attribute_group
diff --git a/schema-next.yaml b/schema-next.yaml
index 14ddba0a2..28447ad5d 100644
--- a/schema-next.yaml
+++ b/schema-next.yaml
@@ -14,6 +14,15 @@ versions:
- rename_metrics:
k8s.replication_controller.desired_pods: k8s.replicationcontroller.desired_pods
k8s.replication_controller.available_pods: k8s.replicationcontroller.available_pods
+ # https://github.com/open-telemetry/semantic-conventions/pull/1896
+ - rename_metrics:
+ system.cpu.time: cpu.time
+ system.cpu.utilization: cpu.utilization
+ system.cpu.frequency: cpu.frequency
+ # https://github.com/open-telemetry/semantic-conventions/pull/1896
+ - rename_attributes:
+ attribute_map:
+ system.cpu.logical_number: cpu.logical_number
1.30.0:
all:
changes: