Skip to content
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

process: add process.status attribute #1212

Closed
wants to merge 4 commits into from
Closed
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
17 changes: 17 additions & 0 deletions .chloggen/process_status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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: Deprecate system.process.status in favour of process.status. Use process.status as a process resource 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: [1181]

# (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: 10 additions & 0 deletions docs/attributes-registry/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ An operating system process.
| `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.saved_user.name` | string | The username of the saved user. | `operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.status` | string | The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) | `running` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.user.name` | string | The username of the effective user of the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.vpid` | int | Virtual process identifier. [1] | `12` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand All @@ -58,6 +59,15 @@ An operating system process.
| `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`process.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 |
| ---------- | ----------- | ---------------------------------------------------------------- |
| `defunct` | defunct | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `running` | running | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `sleeping` | sleeping | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `stopped` | stopped | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Process Deprecated Attributes

Deprecated process attributes.
Expand Down
36 changes: 14 additions & 22 deletions docs/attributes-registry/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- [System Memory](#system-memory-attributes)
- [System Network](#system-network-attributes)
- [System Paging](#system-paging-attributes)
- [System Process](#system-process-attributes)

## System Attributes

Expand All @@ -35,10 +34,11 @@ Describes System CPU 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`. |
| 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.process.status` | string | Deprecated, use `process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `process.status` |
| `system.processes.status` | string | Deprecated, use `process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `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.

Expand All @@ -52,6 +52,15 @@ Deprecated system attributes.
| `system` | system | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `user` | user | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`system.process.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 |
| ---------- | ----------- | ---------------------------------------------------------------- |
| `defunct` | defunct | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `running` | running | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `sleeping` | sleeping | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `stopped` | stopped | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`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 |
Expand Down Expand Up @@ -164,20 +173,3 @@ Describes System Memory Paging attributes
| ------- | ----------- | ---------------------------------------------------------------- |
| `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## System Process Attributes

Describes System Process attributes

| Attribute | Type | Description | Examples | Stability |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- |
| `system.process.status` | string | The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) | `running` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`system.process.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 |
| ---------- | ----------- | ---------------------------------------------------------------- |
| `defunct` | defunct | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `running` | running | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `sleeping` | sleeping | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `stopped` | stopped | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
19 changes: 16 additions & 3 deletions docs/resource/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
| [`process.command`](/docs/attributes-registry/process.md) | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | `Conditionally Required` [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.command_args`](/docs/attributes-registry/process.md) | string[] | All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `["cmd/otecol", "--config=config.yaml"]` | `Conditionally Required` [2] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.command_line`](/docs/attributes-registry/process.md) | string | The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.executable.path`](/docs/attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.owner`](/docs/attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.executable.path`](/docs/attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.owner`](/docs/attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.status`](/docs/attributes-registry/process.md) | string | The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) | `running` | `Conditionally Required` [6] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.parent_pid`](/docs/attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

Expand All @@ -53,6 +54,18 @@

**[5]:** See [Selecting process attributes](#selecting-process-attributes) for details.

**[6]:** See [Selecting process attributes](#selecting-process-attributes) for details.



`process.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 |
|---|---|---|
| `defunct` | defunct | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `running` | running | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `sleeping` | sleeping | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `stopped` | stopped | ![Experimental](https://img.shields.io/badge/-experimental-blue) |



Expand Down
4 changes: 2 additions & 2 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1368,9 +1368,9 @@ This metric is [recommended][MetricRecommended].

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`system.process.status`](/docs/attributes-registry/system.md) | string | The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) | `running` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`process.status`](/docs/attributes-registry/process.md) | string | The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) | `running` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`system.process.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.
`process.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 |
|---|---|---|
Expand Down
2 changes: 1 addition & 1 deletion model/metrics/system-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ groups:
instrument: updowncounter
unit: "{process}"
attributes:
- ref: system.process.status
- ref: process.status

- id: metric.system.process.created
type: metric
Expand Down
26 changes: 23 additions & 3 deletions model/registry/deprecated/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ groups:
- id: defunct
value: 'defunct'
stability: experimental
brief: "Deprecated, use `system.process.status` instead."
deprecated: "Replaced by `system.process.status`."
brief: "Deprecated, use `process.status` instead."
deprecated: "Replaced by `process.status`"
stability: experimental
examples: ["running"]
- id: system.cpu.state
Expand Down Expand Up @@ -50,5 +50,25 @@ groups:
stability: experimental
brief: "Deprecated, use `cpu.mode` instead."
stability: experimental
deprecated: 'Replaced by `cpu.mode`'
deprecated: "Replaced by `cpu.mode`"
examples: [ "idle", "interrupt" ]
- id: system.process.status
type:
allow_custom_values: true
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
allow_custom_values: true

value is ignored and the flag will be removed at some point

members:
- id: running
value: 'running'
stability: experimental
- id: sleeping
value: 'sleeping'
stability: experimental
- id: stopped
value: 'stopped'
stability: experimental
- id: defunct
value: 'defunct'
stability: experimental
stability: experimental
brief: "Deprecated, use `process.status` instead."
deprecated: "Replaced by `process.status`"
examples: ["running"]
20 changes: 20 additions & 0 deletions model/registry/process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,23 @@ groups:
value: 'minor'
stability: experimental
stability: experimental
- id: status
type:
allow_custom_values: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
allow_custom_values: true

same here, value is ignored

members:
- id: running
value: 'running'
stability: experimental
- id: sleeping
value: 'sleeping'
stability: experimental
- id: stopped
value: 'stopped'
stability: experimental
- id: defunct
value: 'defunct'
stability: experimental
stability: experimental
brief: >
The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
examples: ["running"]
Loading
Loading