Skip to content

Commit

Permalink
process: add process.status attribute
Browse files Browse the repository at this point in the history
This PR deprecates `system.process.status` and replaces it with
`process.status`. The previous usage of `system.process.status` has been
replaced with `process.status`, and `process.status` has also been add
as a resource attribute to the `process` resource.
  • Loading branch information
braydonk committed Jul 8, 2024
1 parent a328d73 commit 1c0f030
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 58 deletions.
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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `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
23 changes: 21 additions & 2 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 @@ -52,3 +52,22 @@ groups:
stability: experimental
deprecated: 'Replaced by `cpu.mode`'
examples: [ "idle", "interrupt" ]
- id: system.process.status
type:
allow_custom_values: true
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."
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
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"]
28 changes: 1 addition & 27 deletions model/registry/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,30 +199,4 @@ groups:
stability: experimental
stability: experimental
brief: "A stateless protocol MUST NOT set this attribute"
examples: ["close_wait"]
# system.process.* attribute group
- id: registry.system.process
prefix: system.process
type: attribute_group
brief: "Describes System Process attributes"
attributes:
- id: status
type:
allow_custom_values: true
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"]
examples: ["close_wait"]
Loading

0 comments on commit 1c0f030

Please sign in to comment.