Skip to content
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/process_req_levels.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: process

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Added specific requirement levels to all attribute refs within process metrics.

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

# (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:
10 changes: 5 additions & 5 deletions docs/system/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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) | `Recommended` | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the description (data points with no mode labels, or only data points with mode labels.), should this be conditionally required?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to aggregate process.cpu.time over cpu.mode (data points with no mode labels)? I think that should be equal to the process.uptime metric, making the aggregation not recommended (attribute required)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I actually don't know if I agree with the brief here; I'm not sure at what point we would ever recommend recording CPU times without a cpu mode. I don't think we have any unambiguous way to report that. A process.cpu.time metric without the mode in my eyes could be one of two things:

  1. Sum of all states, which is equivalent to all elapsed wall clock seconds (aka equivalent to process.uptime as @rogercoll mentioned)
  2. Something like user + system with wait state ignored

1 is generally not useful and I think we would recommend against doing it as it could be easily misinterpreted; a dashboard interpreting a "cpu time" metric that is aggregated in this way could make it look like a process is literally operating on a CPU at all times.

I could see 2 being useful somehow.

The problem then is the ambiguity of these two scenarios; a process.cpu.time metric reported without a cpu.mode has no way to encode which of these 2 versions of the metric being reported are actually being used. The way to disambiguate a scenario that allows the second scenario to exist would just be to report a cpu.mode attribute, defeating the purpose of ever reporting without the attribute. We could try and write some kind of guidance that says if you report without an attribute then what you mean is all non-wait time of the process, but that also has usability concerns because if a process is truly using all wall clock seconds to operate on the CPU, it is much easier to know unambiguously that this is the case if you also report a wait state with a value of 0.
Also in spite of all of this, scenario 2 is better served by a query-time aggregation anyway; if instrumentation aggregated all non-wait states at collection time you'd never be able to split that out again. (this is a similar scenario to utilization metrics erasing important time information because of collection-time aggregation).

Hopefully my rant is clear enough. All of this is to say that I believe the attribute should remain required, and we should adjust the brief to not suggest that we ever want this metric reported without a cpu.mode. How does that sound @open-telemetry/semconv-system-approvers ?


**[1] `cpu.mode`:** Following states SHOULD be used: `user`, `system`, `wait`

Expand Down Expand Up @@ -106,7 +106,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) | `Recommended` | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` |
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` |

**[1] `cpu.mode`:** Following states SHOULD be used: `user`, `system`, `wait`

Expand Down Expand Up @@ -189,7 +189,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 |
|---|---|---|---|---|---|
| [`disk.io.direction`](/docs/registry/attributes/disk.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The disk IO operation direction. | `read` |
| [`disk.io.direction`](/docs/registry/attributes/disk.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The disk IO operation direction. | `read` |

---

Expand Down Expand Up @@ -224,7 +224,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 |
|---|---|---|---|---|---|
| [`network.io.direction`](/docs/registry/attributes/network.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The network IO operation direction. | `transmit` |
| [`network.io.direction`](/docs/registry/attributes/network.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The network IO operation direction. | `transmit` |

---

Expand Down Expand Up @@ -299,7 +299,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 |
|---|---|---|---|---|---|
| [`process.context_switch.type`](/docs/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary`; `involuntary` |
| [`process.context_switch.type`](/docs/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary`; `involuntary` |

---

Expand Down
6 changes: 6 additions & 0 deletions model/process/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ groups:
unit: "s"
attributes:
- ref: cpu.mode
requirement_level: required
brief: >
A process SHOULD be characterized _either_ by data points with no `mode`
labels, _or only_ data points with `mode` labels.
Expand All @@ -32,6 +33,7 @@ groups:
unit: "1"
attributes:
- ref: cpu.mode
requirement_level: required
brief: >
A process SHOULD be characterized _either_ by data points with no `mode`
labels, _or only_ data points with `mode` labels.
Expand Down Expand Up @@ -79,6 +81,7 @@ groups:
unit: "By"
attributes:
- ref: disk.io.direction
requirement_level: required
entity_associations:
- process

Expand All @@ -94,6 +97,7 @@ groups:
unit: "By"
attributes:
- ref: network.io.direction
requirement_level: required
entity_associations:
- process

Expand Down Expand Up @@ -135,6 +139,7 @@ groups:
unit: "{context_switch}"
attributes:
- ref: process.context_switch.type
requirement_level: required
entity_associations:
- process

Expand All @@ -150,6 +155,7 @@ groups:
unit: "{fault}"
attributes:
- ref: system.paging.fault.type
requirement_level: recommended
entity_associations:
- process

Expand Down
Loading