Skip to content
Merged
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/stabilise-cpu-mode.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: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: cpu

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Promote `cpu.mode` attribute and its enum members to `release_candidate`

# 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: [3694]

# (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:
17 changes: 9 additions & 8 deletions docs/non-normative/groups/system/cpu-metrics-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ metrics across the different areas of the Semantic Conventions.

## Policy

* **recommended**: `*.cpu.time`
* **opt-in** (optional): `*.cpu.utilization`, `*.cpu.usage`,
- **recommended**: `*.cpu.time`
- **opt-in** (optional): `*.cpu.utilization`, `*.cpu.usage`,
`*.cpu.limit_utilization`, `*.cpu.request_utilization`

## Rationale
Expand All @@ -40,16 +40,16 @@ uniquely implemented in other systems like the

## Implementation Guidance

* SHOULD emit `*.cpu.time` by default for system, process container, and k8s
- SHOULD emit `*.cpu.time` by default for system, process container, and k8s
resources.
* SHOULD gate `*.cpu.*utilization` and `*.cpu.usage` metrics behind explicit
- SHOULD gate `*.cpu.*utilization` and `*.cpu.usage` metrics behind explicit
configuration.

## Backend Guidance

* SHOULD provide transforms or views to derive utilization/usage from
- SHOULD provide transforms or views to derive utilization/usage from
`*.cpu.time` when helpful.
* SHOULD treat `*.cpu.time` as the canonical source of truth across system,
- SHOULD treat `*.cpu.time` as the canonical source of truth across system,
container, and k8s resources.

## Using CPU Time
Expand Down Expand Up @@ -98,8 +98,9 @@ used:

`avg(sum(rate(system.cpu.time{cpu.mode!="idle"}[5m])) by (cpu.logical_number))/(5*60)`

Note that the above formulas can be ambiguous and hence they are not standardized
as part of the Semantic Conventions project. They are only provided as examples.
Note that the above formulas can be ambiguous and hence they are not
standardized as part of the Semantic Conventions project. They are only provided
as examples.

Projects like
[Prometheus Node Exporter](https://github.com/prometheus/node_exporter/blob/b959d48df950d5c446660eca3354c26eb997ca44/docs/node-mixin/lib/prom-mixin.libsonnet#L85-L87)
Expand Down
27 changes: 16 additions & 11 deletions docs/non-normative/groups/system/design-philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,25 @@ baseline level of knowledge of the concepts being instrumented**. The `brief`
and `note` fields of metrics and attributes should be used to convey information
that is crucial to understanding the instrumentation intention, i.e.:

* Differences in the same piece of data when it is instrumented on different
- Differences in the same piece of data when it is instrumented on different
platforms
* When we recommend calculations be done on particular data rather than
- When we recommend calculations be done on particular data rather than
surfacing direct values from existing tools
* When particular names or enum values were chosen when there are common
- When particular names or enum values were chosen when there are common
alternate terms for the same concept

For root metrics and attributes, we will strive to always have a `brief` field.
The `brief` field should explain what the metric/attribute is, and if the
explanation of a value is simple (i.e. simply surfacing a value from a common
source like `procfs`) then the explanation of what the value should be can go in
the brief. If the value needs some calculation explanation and justification,
the information should be moved to the `note` field.
For enum values, it is often the case that the intention of these values is
obvious given whatever `brief` was provided for the attribute as a whole. A
brief can be included in a scenario where we have had to make some choice on the
value that isn't immediately obvious; the most common scenario is when some
terminology differs across platforms and we had to choose one term to represent
all scenarios. In this case, the `brief` can be used to clarify our intention.
the information should be moved to the `note` field. For enum values, it is
often the case that the intention of these values is obvious given whatever
`brief` was provided for the attribute as a whole. A brief can be included in a
scenario where we have had to make some choice on the value that isn't
immediately obvious; the most common scenario is when some terminology differs
across platforms and we had to choose one term to represent all scenarios. In
this case, the `brief` can be used to clarify our intention.

In cases where information about a concept is required to describe our intention
for instrumentation, all information must come with citations to authoritative
Expand Down Expand Up @@ -301,6 +301,11 @@ had OS root namespaces, different sources like `system`, `process`, etc. could
get very tangled within each OS namespace, defeating the intended design
philosophy.

However, to clarify — when we refer to avoiding OS names at the “root namespace” level, we also mean avoiding them at the area level. The OS name should appear after the area of concern (such as `system.memory.linux.*`), not before it. This ensures that users can first navigate by functional area (e.g. memory, CPU, network) and then, if necessary, drill down into OS-specific variants within that area.
However, to clarify — when we refer to avoiding OS names at the “root namespace”
level, we also mean avoiding them at the area level. The OS name should appear
after the area of concern (such as `system.memory.linux.*`), not before it. This
ensures that users can first navigate by functional area (e.g. memory, CPU,
network) and then, if necessary, drill down into OS-specific variants within
that area.

[use cases doc]: ./use-cases.md
16 changes: 8 additions & 8 deletions docs/registry/attributes/cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ Attributes specific to a cpu instance.
| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="cpu-logical-number" href="#cpu-logical-number">`cpu.logical_number`</a> | ![Development](https://img.shields.io/badge/-development-blue) | int | The logical CPU number [0..n-1] | `1` |
| <a id="cpu-mode" href="#cpu-mode">`cpu.mode`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The mode of the CPU | `user`; `system` |
| <a id="cpu-mode" href="#cpu-mode">`cpu.mode`</a> | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | string | The mode of the CPU | `user`; `system` |

---

`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` | IO Wait | ![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) |
| `idle` | Idle | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `interrupt` | Interrupt | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `iowait` | IO Wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `nice` | Nice | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `steal` | Steal | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `system` | System | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `user` | User | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
16 changes: 8 additions & 8 deletions docs/runtime/dotnet-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ This metric reports the same values as accessing the corresponding processor tim

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The mode of the CPU | `user`; `system` |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | The mode of the CPU | `user`; `system` |

---

`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` | IO Wait | ![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) |
| `idle` | Idle | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `interrupt` | Interrupt | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `iowait` | IO Wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `nice` | Nice | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `steal` | Steal | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `system` | System | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `user` | User | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
32 changes: 16 additions & 16 deletions docs/system/container-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This metric is [recommended][MetricRecommended].

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [1] | 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. [2] | `user`; `system` |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Conditionally Required` [1] | 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. [2] | `user`; `system` |

**[1] `cpu.mode`:** Required if mode is available, i.e. metrics coming from the Docker Stats API, containerd stats or cAdvisor.

Expand All @@ -84,13 +84,13 @@ In pure container environments the CPU's mode is usually available and cpu.mode

| Value | Description | Stability |
| --- | --- | --- |
| `idle` | Idle | ![Development](https://img.shields.io/badge/-development-blue) |
| `interrupt` | Interrupt | ![Development](https://img.shields.io/badge/-development-blue) |
| `iowait` | IO Wait | ![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) |
| `idle` | Idle | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `interrupt` | Interrupt | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `iowait` | IO Wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `nice` | Nice | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `steal` | Steal | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `system` | System | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `user` | User | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand All @@ -115,7 +115,7 @@ This metric is [opt-in][MetricOptIn].

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [1] | 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. [2] | `user`; `system` |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Conditionally Required` [1] | 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. [2] | `user`; `system` |

**[1] `cpu.mode`:** Required if mode is available, i.e. metrics coming from the Docker Stats API, containerd stats or cAdvisor.

Expand All @@ -127,13 +127,13 @@ This metric is [opt-in][MetricOptIn].

| Value | Description | Stability |
| --- | --- | --- |
| `idle` | Idle | ![Development](https://img.shields.io/badge/-development-blue) |
| `interrupt` | Interrupt | ![Development](https://img.shields.io/badge/-development-blue) |
| `iowait` | IO Wait | ![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) |
| `idle` | Idle | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `interrupt` | Interrupt | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `iowait` | IO Wait | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `nice` | Nice | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `steal` | Steal | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `system` | System | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `user` | User | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
Loading
Loading