Merge *.cpu.state attributes to a common cpu.mode attribute (#1026)

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Alexandra Konrad <alexandra.konrad@elastic.co>
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
Co-authored-by: Braydon Kains <93549768+braydonk@users.noreply.github.com>
Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
Chris Mark 2024-06-26 10:46:38 +03:00 committed by GitHub
parent ad05f1d8d3
commit db1b84d45d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 272 additions and 126 deletions

22
.chloggen/merge_cpu_states.yaml Executable file
View File

@ -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: Rename `process.cpu.state`, `container.cpu.state`, and `system.cpu.state` attributes into a common `cpu.mode` attribute
# 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: [840]
# (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:

View File

@ -28,6 +28,7 @@ body:
- area:cloudevents - area:cloudevents
- area:code - area:code
- area:container - area:container
- area:cpu
- area:db - area:db
- area:deployment - area:deployment
- area:destination - area:destination

View File

@ -21,6 +21,7 @@ body:
- area:cloudevents - area:cloudevents
- area:code - area:code
- area:container - area:container
- area:cpu
- area:db - area:db
- area:deployment - area:deployment
- area:destination - area:destination

View File

@ -30,6 +30,7 @@ body:
- area:cloudevents - area:cloudevents
- area:code - area:code
- area:container - area:container
- area:cpu
- area:db - area:db
- area:deployment - area:deployment
- area:destination - area:destination

View File

@ -40,6 +40,7 @@ Currently, the following namespaces exist:
- [CloudEvents](cloudevents.md) - [CloudEvents](cloudevents.md)
- [Code](code.md) - [Code](code.md)
- [Container](container.md) - [Container](container.md)
- [CPU](cpu.md)
- [Db](db.md) - [Db](db.md)
- [Deployment](deployment.md) - [Deployment](deployment.md)
- [Destination](destination.md) - [Destination](destination.md)

View File

@ -18,7 +18,6 @@ A container instance.
| `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol, --config, config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol, --config, config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.cpu.state` | string | The CPU state for this data point. | `user`; `kernel` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@ -36,6 +35,15 @@ The ID is assigned by the container runtime and can vary in different environmen
**[3]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. **[3]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field.
## Container Deprecated Attributes
Describes deprecated container attributes.
| Attribute | Type | Description | Examples | Stability |
| ------------------------ | ------ | ------------------------------------------ | --------------------------- | --------------------------------------------------------------------------------------------- |
| `container.cpu.state` | string | Deprecated, use `cpu.mode` instead. | `user`; `kernel` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `cpu.mode` |
| `container.labels.<key>` | string | Deprecated, use `container.label` instead. | `container.label.app=nginx` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `container.label`. |
`container.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. `container.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.
| Value | Description | Stability | | Value | Description | Stability |
@ -43,11 +51,3 @@ The ID is assigned by the container runtime and can vary in different environmen
| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | When CPU is used by the system (host OS) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | When CPU is used by the system (host OS) | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
## Container Deprecated Attributes
Describes deprecated container attributes.
| Attribute | Type | Description | Examples | Stability |
| ------------------------ | ------ | ------------------------------------------ | --------------------------- | --------------------------------------------------------------------------------------------- |
| `container.labels.<key>` | string | Deprecated, use `container.label` instead. | `container.label.app=nginx` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `container.label`. |

View File

@ -0,0 +1,28 @@
<!--- Hugo front matter used to generate the website version of this page:
--->
<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->
# CPU
## CPU Attributes
Attributes specific to a cpu instance.
| Attribute | Type | Description | Examples | Stability |
| ---------- | ------ | ------------------- | ---------------- | ---------------------------------------------------------------- |
| `cpu.mode` | string | The mode of the CPU | `user`; `system` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`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 | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

View File

@ -7,7 +7,7 @@
# Process # Process
- [Process](#process-attributes) - [Process](#process-attributes)
- [Process Cpu](#process-cpu-attributes) - [Process Deprecated](#process-deprecated-attributes)
## Process Attributes ## Process Attributes
@ -58,13 +58,13 @@ An operating system process.
| `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
## Process Cpu Attributes ## Process Deprecated Attributes
Attributes for process CPU Deprecated process attributes.
| Attribute | Type | Description | Examples | Stability | | Attribute | Type | Description | Examples | Stability |
| ------------------- | ------ | ----------------------------- | ------------------------ | ---------------------------------------------------------------- | | ------------------- | ------ | ----------------------------------- | ------------------------ | ------------------------------------------------------------------------------------- |
| `process.cpu.state` | string | The CPU state of the process. | `system`; `user`; `wait` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.cpu.state` | string | Deprecated, use `cpu.mode` instead. | `system`; `user`; `wait` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `cpu.mode` |
`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. `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.

View File

@ -23,14 +23,22 @@ Describes System attributes
| --------------- | ------ | --------------------- | -------------- | ---------------------------------------------------------------- | | --------------- | ------ | --------------------- | -------------- | ---------------------------------------------------------------- |
| `system.device` | string | The device identifier | `(identifier)` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system.device` | string | The device identifier | `(identifier)` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
## System Cpu Attributes ## System CPU Attributes
Describes System CPU attributes Describes System CPU attributes
| Attribute | Type | Description | Examples | Stability | | Attribute | Type | Description | Examples | Stability |
| --------------------------- | ------ | ------------------------------- | ------------------- | ---------------------------------------------------------------- | | --------------------------- | ---- | ------------------------------- | -------- | ---------------------------------------------------------------- |
| `system.cpu.logical_number` | int | The logical CPU number [0..n-1] | `1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system.cpu.logical_number` | int | The logical CPU number [0..n-1] | `1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system.cpu.state` | string | The state of the CPU | `idle`; `interrupt` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
## System Deprecated Attributes
Deprecated system attributes.
| Attribute | Type | Description | Examples | Stability |
| ------------------------- | ------ | ------------------------------------------------ | ------------------- | --------------------------------------------------------------------------------------------------- |
| `system.cpu.state` | string | Deprecated, use `cpu.mode` instead. | `idle`; `interrupt` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `cpu.mode` |
| `system.processes.status` | string | Deprecated, use `system.process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `system.process.status`. |
`system.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. `system.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.
@ -44,14 +52,6 @@ Describes System CPU attributes
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
## System Deprecated Attributes
Deprecated system attributes.
| Attribute | Type | Description | Examples | Stability |
| ------------------------- | ------ | ------------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------- |
| `system.processes.status` | string | Deprecated, use `system.process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `system.process.status`. |
`system.processes.status` 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. `system.processes.status` 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 | | Value | Description | Stability |

View File

@ -42,15 +42,24 @@ This metric is [opt-in][MetricOptIn].
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| [`container.cpu.state`](/docs/attributes-registry/container.md) | string | The CPU state for this data point. A container SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `user`; `kernel` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | The CPU mode for this data point. A container's CPU metric SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`container.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. **[1]:** Following states SHOULD be used: `user`, `system`, `kernel`
`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 | | Value | Description | Stability |
|---|---|---| |---|---|---|
| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | When CPU is used by the system (host OS) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

View File

@ -75,15 +75,24 @@ This metric is [recommended][MetricRecommended].
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| [`process.cpu.state`](/docs/attributes-registry/process.md) | string | A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system`; `user`; `wait` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`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. **[1]:** Following states SHOULD be used: `user`, `system`, `wait`
`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 | | Value | Description | Stability |
|---|---|---| |---|---|---|
| `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `wait` | wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@ -122,15 +131,24 @@ This metric is [recommended][MetricRecommended].
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| [`process.cpu.state`](/docs/attributes-registry/process.md) | string | A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `system`; `user`; `wait` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`cpu.mode`](/docs/attributes-registry/cpu.md) | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`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. **[1]:** Following states SHOULD be used: `user`, `system`, `wait`
`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 | | Value | Description | Stability |
|---|---|---| |---|---|---|
| `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `wait` | wait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

View File

@ -104,16 +104,21 @@ This metric is [recommended][MetricRecommended].
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`system.cpu.state`](/docs/attributes-registry/system.md) | string | The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. | `idle`; `interrupt` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`system.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. **[1]:** 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 | | Value | Description | Stability |
|---|---|---| |---|---|---|
| `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@ -156,16 +161,21 @@ This metric is [recommended][MetricRecommended].
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`system.cpu.logical_number`](/docs/attributes-registry/system.md) | int | The logical CPU number [0..n-1] | `1` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`system.cpu.state`](/docs/attributes-registry/system.md) | string | The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels. | `idle`; `interrupt` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
`system.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. **[1]:** 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 | | Value | Description | Stability |
|---|---|---| |---|---|---|
| `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `interrupt` | interrupt | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `iowait` | iowait | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `kernel` | kernel | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `nice` | nice | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `steal` | steal | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

View File

@ -10,8 +10,9 @@ groups:
instrument: counter instrument: counter
unit: "s" unit: "s"
attributes: attributes:
- ref: container.cpu.state - ref: cpu.mode
brief: "The CPU state for this data point. A container SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels." brief: "The CPU mode for this data point. A container's CPU metric 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`, `kernel`"
requirement_level: opt_in requirement_level: opt_in
# container.memory.* metrics and attribute group # container.memory.* metrics and attribute group

View File

@ -7,10 +7,11 @@ groups:
instrument: counter instrument: counter
unit: "s" unit: "s"
attributes: attributes:
- ref: process.cpu.state - ref: cpu.mode
brief: > brief: >
A process SHOULD be characterized _either_ by data points with no `state` A process SHOULD be characterized _either_ by data points with no `mode`
labels, _or only_ data points with `state` labels. labels, _or only_ data points with `mode` labels.
note: "Following states SHOULD be used: `user`, `system`, `wait`"
- id: metric.process.cpu.utilization - id: metric.process.cpu.utilization
type: metric type: metric
@ -22,10 +23,11 @@ groups:
instrument: gauge instrument: gauge
unit: "1" unit: "1"
attributes: attributes:
- ref: process.cpu.state - ref: cpu.mode
brief: > brief: >
A process SHOULD be characterized _either_ by data points with no `state` A process SHOULD be characterized _either_ by data points with no `mode`
labels, _or only_ data points with `state` labels. labels, _or only_ data points with `mode` labels.
note: "Following states SHOULD be used: `user`, `system`, `wait`"
- id: metric.process.memory.usage - id: metric.process.memory.usage
type: metric type: metric

View File

@ -8,8 +8,9 @@ groups:
instrument: counter instrument: counter
unit: "s" unit: "s"
attributes: attributes:
- ref: system.cpu.state - ref: cpu.mode
brief: "The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels." 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 - ref: system.cpu.logical_number
- id: metric.system.cpu.utilization - id: metric.system.cpu.utilization
@ -20,8 +21,9 @@ groups:
instrument: gauge instrument: gauge
unit: "1" unit: "1"
attributes: attributes:
- ref: system.cpu.state - ref: cpu.mode
brief: "The CPU state for this data point. A system's CPU SHOULD be characterized *either* by data points with no `state` labels, *or only* data points with `state` labels." 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 - ref: system.cpu.logical_number
- id: metric.system.cpu.frequency - id: metric.system.cpu.frequency

View File

@ -95,22 +95,3 @@ groups:
brief: > brief: >
Container labels, `<key>` being the label name, the value being the label value. Container labels, `<key>` being the label name, the value being the label value.
examples: [ 'container.label.app=nginx' ] examples: [ 'container.label.app=nginx' ]
- id: cpu.state
brief: "The CPU state for this data point."
type:
allow_custom_values: true
members:
- id: user
value: 'user'
brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)."
stability: experimental
- id: system
value: 'system'
brief: "When CPU is used by the system (host OS)"
stability: experimental
- id: kernel
value: 'kernel'
brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)."
stability: experimental
stability: experimental
examples: ["user", "kernel"]

38
model/registry/cpu.yaml Normal file
View File

@ -0,0 +1,38 @@
groups:
- id: registry.cpu
prefix: cpu
type: attribute_group
brief: Attributes specific to a cpu instance.
attributes:
- id: mode
brief: "The mode of the CPU"
type:
allow_custom_values: true
# TODO: Fix how enum members are used in semantic conventions after https://github.com/open-telemetry/build-tools/issues/192 is merged
members:
- id: user
value: 'user'
stability: experimental
- id: system
value: 'system'
stability: experimental
- id: nice
value: 'nice'
stability: experimental
- id: idle
value: 'idle'
stability: experimental
- id: iowait
value: 'iowait'
stability: experimental
- id: interrupt
value: 'interrupt'
stability: experimental
- id: steal
value: 'steal'
stability: experimental
- id: kernel
value: 'kernel'
stability: experimental
stability: experimental
examples: [ "user", "system" ]

View File

@ -9,3 +9,23 @@ groups:
brief: "Deprecated, use `container.label` instead." brief: "Deprecated, use `container.label` instead."
stability: experimental stability: experimental
deprecated: "Replaced by `container.label`." deprecated: "Replaced by `container.label`."
- id: container.cpu.state
brief: "Deprecated, use `cpu.mode` instead."
type:
allow_custom_values: true
members:
- id: user
value: 'user'
brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)."
stability: experimental
- id: system
value: 'system'
brief: "When CPU is used by the system (host OS)"
stability: experimental
- id: kernel
value: 'kernel'
brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)."
stability: experimental
stability: experimental
deprecated: 'Replaced by `cpu.mode`'
examples: [ "user", "kernel" ]

View File

@ -0,0 +1,21 @@
groups:
- id: registry.process.deprecated
type: attribute_group
brief: "Deprecated process attributes."
attributes:
- id: process.cpu.state
brief: "Deprecated, use `cpu.mode` instead."
deprecated: 'Replaced by `cpu.mode`'
type:
allow_custom_values: true
members:
- id: system
value: 'system'
stability: experimental
- id: user
value: 'user'
stability: experimental
- id: wait
value: 'wait'
stability: experimental
stability: experimental

View File

@ -23,3 +23,32 @@ groups:
deprecated: "Replaced by `system.process.status`." deprecated: "Replaced by `system.process.status`."
stability: experimental stability: experimental
examples: ["running"] examples: ["running"]
- id: system.cpu.state
type:
allow_custom_values: true
members:
- id: user
value: 'user'
stability: experimental
- id: system
value: 'system'
stability: experimental
- id: nice
value: 'nice'
stability: experimental
- id: idle
value: 'idle'
stability: experimental
- id: iowait
value: 'iowait'
stability: experimental
- id: interrupt
value: 'interrupt'
stability: experimental
- id: steal
value: 'steal'
stability: experimental
brief: "Deprecated, use `cpu.mode` instead."
stability: experimental
deprecated: 'Replaced by `cpu.mode`'
examples: [ "idle", "interrupt" ]

View File

@ -196,26 +196,3 @@ groups:
value: 'minor' value: 'minor'
stability: experimental stability: experimental
stability: experimental stability: experimental
- id: registry.process.cpu
prefix: process.cpu
type: attribute_group
brief: >
Attributes for process CPU
attributes:
- id: state
brief: >
The CPU state of the process.
type:
allow_custom_values: true
members:
- id: system
value: 'system'
stability: experimental
- id: user
value: 'user'
stability: experimental
- id: wait
value: 'wait'
stability: experimental
stability: experimental

View File

@ -16,34 +16,6 @@ groups:
type: attribute_group type: attribute_group
brief: "Describes System CPU attributes" brief: "Describes System CPU attributes"
attributes: attributes:
- id: state
type:
allow_custom_values: true
members:
- id: user
value: 'user'
stability: experimental
- id: system
value: 'system'
stability: experimental
- id: nice
value: 'nice'
stability: experimental
- id: idle
value: 'idle'
stability: experimental
- id: iowait
value: 'iowait'
stability: experimental
- id: interrupt
value: 'interrupt'
stability: experimental
- id: steal
value: 'steal'
stability: experimental
brief: "The state of the CPU"
stability: experimental
examples: ["idle", "interrupt"]
- id: logical_number - id: logical_number
type: int type: int
stability: experimental stability: experimental

View File

@ -41,7 +41,18 @@ versions:
# https://github.com/open-telemetry/semantic-conventions/pull/1006 # https://github.com/open-telemetry/semantic-conventions/pull/1006
- rename_metrics: - rename_metrics:
messaging.publish.messages: messaging.client.published.messages messaging.publish.messages: messaging.client.published.messages
# https://github.com/open-telemetry/semantic-conventions/pull/1026
- rename_attributes:
attribute_map:
system.cpu.state: cpu.mode
process.cpu.state: cpu.mode
container.cpu.state: cpu.mode
apply_to_metrics:
- system.cpu.time
- system.cpu.utilization
- process.cpu.time
- process.cpu.utilization
- container.cpu.time
1.26.0: 1.26.0:
metrics: metrics:
changes: changes:

View File

@ -10,6 +10,7 @@ acronyms:
- iOS - iOS
- AWS - AWS
- CloudEvents - CloudEvents
- CPU
- CosmosDB - CosmosDB
- DynamoDB - DynamoDB
- ECS - ECS