Skip to content

Revert cpu.* metrics to system.cpu.* #2295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/cpu_time_revert.yaml
Original file line number Diff line number Diff line change
@@ -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: Revert the change that moved `system.cpu.*` to `cpu.*`. The 3 affected metrics are back in `system.cpu.*`.

# 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:
1 change: 0 additions & 1 deletion docs/system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ 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.
Expand Down
133 changes: 0 additions & 133 deletions docs/system/cpu-metrics.md

This file was deleted.

84 changes: 84 additions & 0 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,90 @@ This metric is [recommended][MetricRecommended].
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `system.cpu.time`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.system.cpu.time -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `system.cpu.time` | Counter | `s` | Seconds each logical CPU spent on each mode | ![Development](https://img.shields.io/badge/-development-blue) | `host` |

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`cpu.logical_number`](/docs/registry/attributes/cpu.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | string | The mode of the CPU [1] | `user`; `system` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

**[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](https://img.shields.io/badge/-development-blue) |
| `interrupt` | interrupt | ![Development](https://img.shields.io/badge/-development-blue) |
| `iowait` | iowait | ![Development](https://img.shields.io/badge/-development-blue) |
| `kernel` | kernel | ![Development](https://img.shields.io/badge/-development-blue) |
| `nice` | nice | ![Development](https://img.shields.io/badge/-development-blue) |
| `steal` | steal | ![Development](https://img.shields.io/badge/-development-blue) |
| `system` | system | ![Development](https://img.shields.io/badge/-development-blue) |
| `user` | user | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `system.cpu.utilization`

This metric is [opt-in][MetricOptIn].

<!-- semconv metric.system.cpu.utilization -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `system.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](https://img.shields.io/badge/-development-blue) | `host` |

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`cpu.logical_number`](/docs/registry/attributes/cpu.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | string | The mode of the CPU [1] | `user`; `system` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |

**[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](https://img.shields.io/badge/-development-blue) |
| `interrupt` | interrupt | ![Development](https://img.shields.io/badge/-development-blue) |
| `iowait` | iowait | ![Development](https://img.shields.io/badge/-development-blue) |
| `kernel` | kernel | ![Development](https://img.shields.io/badge/-development-blue) |
| `nice` | nice | ![Development](https://img.shields.io/badge/-development-blue) |
| `steal` | steal | ![Development](https://img.shields.io/badge/-development-blue) |
| `system` | system | ![Development](https://img.shields.io/badge/-development-blue) |
| `user` | user | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Memory metrics

**Description:** System level memory metrics capture under the namespace `system.memory`.
Expand Down
22 changes: 14 additions & 8 deletions model/cpu/metrics.yaml → model/cpu/deprecated.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
groups:
# cpu.* metrics
- id: metric.cpu.time
type: metric
metric_name: cpu.time
brief: "Deprecated. Use `system.cpu.time` instead."
deprecated:
reason: renamed
renamed_to: system.cpu.time
stability: development
brief: "Seconds each logical CPU spent on each mode"
instrument: counter
unit: "s"
attributes:
Expand All @@ -15,21 +17,25 @@ groups:
- id: metric.cpu.utilization
type: metric
metric_name: cpu.utilization
brief: "Deprecated. Use `system.cpu.utilization` instead."
deprecated:
reason: renamed
renamed_to: system.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`"
note: "Following states SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
- ref: cpu.logical_number

- id: metric.cpu.frequency
type: metric
metric_name: cpu.frequency
brief: "Deprecated. Use `system.cpu.frequency` instead."
deprecated:
reason: renamed
renamed_to: system.cpu.frequency
stability: development
brief: "Operating frequency of the logical CPU in Hertz."
instrument: gauge
unit: "Hz"
attributes:
- ref: cpu.logical_number
unit: "{Hz}"
33 changes: 0 additions & 33 deletions model/system/deprecated/metrics-deprecated.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions model/system/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@ groups:
entity_associations:
- host

- 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
note: "Following states SHOULD be used: `user`, `system`, `nice`, `idle`, `iowait`, `interrupt`, `steal`"
- ref: cpu.logical_number
entity_associations:
- host

- id: metric.system.cpu.utilization
type: metric
metric_name: system.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
entity_associations:
- host

- id: metric.system.cpu.frequency
type: metric
metric_name: system.cpu.frequency
stability: development
brief: "Operating frequency of the logical CPU in Hertz."
instrument: gauge
unit: "Hz"
attributes:
- ref: cpu.logical_number
entity_associations:
- host

# system.memory.* metrics
- id: metric.system.memory.usage
type: metric
Expand Down
7 changes: 7 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ schema_url: https://opentelemetry.io/schemas/next
versions:
next:
1.34.0:
metrics:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/2295
- rename_metrics:
cpu.time: system.cpu.time
cpu.utilization: system.cpu.utilization
cpu.frequency: system.cpu.frequency
1.33.0:
all:
changes:
Expand Down
Loading