diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 6522b0ace3..5b5d3cc940 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -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) | @@ -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. diff --git a/docs/attributes-registry/system.md b/docs/attributes-registry/system.md index c504f989f9..a8d5fc1721 100644 --- a/docs/attributes-registry/system.md +++ b/docs/attributes-registry/system.md @@ -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 @@ -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)
Replaced by `cpu.mode` | -| `system.processes.status` | string | Deprecated, use `system.process.status` instead. | `running` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
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)
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)
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. @@ -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 | @@ -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) | diff --git a/docs/resource/process.md b/docs/resource/process.md index a081022d6f..a6432861f1 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -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) | @@ -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) | diff --git a/docs/system/system-metrics.md b/docs/system/system-metrics.md index cd01009e28..5df67b349b 100644 --- a/docs/system/system-metrics.md +++ b/docs/system/system-metrics.md @@ -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 | |---|---|---| diff --git a/model/metrics/system-metrics.yaml b/model/metrics/system-metrics.yaml index 25e2d06665..868d7608a4 100644 --- a/model/metrics/system-metrics.yaml +++ b/model/metrics/system-metrics.yaml @@ -316,7 +316,7 @@ groups: instrument: updowncounter unit: "{process}" attributes: - - ref: system.process.status + - ref: process.status - id: metric.system.process.created type: metric diff --git a/model/registry/deprecated/system.yaml b/model/registry/deprecated/system.yaml index d220a501b7..8f97805be7 100644 --- a/model/registry/deprecated/system.yaml +++ b/model/registry/deprecated/system.yaml @@ -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 @@ -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"] \ No newline at end of file diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 7cb7451e66..5ba0e97e12 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -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"] diff --git a/model/registry/system.yaml b/model/registry/system.yaml index 790a1374af..866f70e996 100644 --- a/model/registry/system.yaml +++ b/model/registry/system.yaml @@ -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"] \ No newline at end of file diff --git a/model/resource/process.yaml b/model/resource/process.yaml index 36becc7606..b9592b3c41 100644 --- a/model/resource/process.yaml +++ b/model/resource/process.yaml @@ -8,6 +8,7 @@ groups: - ref: process.pid - ref: process.parent_pid - ref: process.executable.name + - ref: process.owner requirement_level: conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.executable.path @@ -22,7 +23,9 @@ groups: - ref: process.command_args requirement_level: conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - - ref: process.owner + - ref: process.status + requirement_level: + conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - id: process.runtime prefix: process.runtime diff --git a/schema-next.yaml b/schema-next.yaml index b2d310bd77..42a356d95a 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -46,6 +46,12 @@ versions: # https://github.com/open-telemetry/semantic-conventions/pull/1006 - rename_metrics: messaging.publish.messages: messaging.client.published.messages + # TODO https://github.com/open-telemetry/semantic-conventions/pull/x + - rename_attributes: + attribute_map: + system.process.status: process.status + apply_to_metrics: + - system.processes.count # https://github.com/open-telemetry/semantic-conventions/pull/1026 - rename_attributes: attribute_map: