From e257619c4dad2256d1d4f12646d353a9fd0fe156 Mon Sep 17 00:00:00 2001 From: braydonk Date: Thu, 9 Jan 2025 18:38:18 +0000 Subject: [PATCH 1/7] add process.name attribute --- model/process/registry.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/model/process/registry.yaml b/model/process/registry.yaml index 4e2c32e4f1..33159a0288 100644 --- a/model/process/registry.yaml +++ b/model/process/registry.yaml @@ -11,6 +11,14 @@ groups: brief: > Process identifier (PID). examples: [1234] + - id: process.name + type: string + stability: experimental + brief: > + The name of the process. 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`. + examples: ['otelcol'] - id: process.parent_pid type: int stability: experimental @@ -65,8 +73,8 @@ groups: stability: experimental brief: > 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`. + to the base name of the target of `/proc/[pid]/exe`. On Windows, + can be set to the base name of `GetProcessImageFileNameW`. examples: ['otelcol'] - id: process.executable.path type: string From ca5ad424413792468c5086bcb47943fcf6aa9a34 Mon Sep 17 00:00:00 2001 From: braydonk Date: Fri, 10 Jan 2025 14:26:00 +0000 Subject: [PATCH 2/7] add changelog entry --- .chloggen/process_name.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .chloggen/process_name.yaml diff --git a/.chloggen/process_name.yaml b/.chloggen/process_name.yaml new file mode 100644 index 0000000000..c35e90f3eb --- /dev/null +++ b/.chloggen/process_name.yaml @@ -0,0 +1,25 @@ +# 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 new attribute `process.name`, adjusted guidance for `process.executable.name` + +# 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: [1736] + +# (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: | + The new `process.name` attribute uses the original guidance for `process.executable.name`, + suggesting use of the `Name` field from `/proc/[pid]/status` on Linux. `process.executable.name` + guidance now suggests using the base name from the `/proc/[pid]/exe` symlink's target path. From 5a679fd2d86cbc3f5b6584f59b37bd5051dd6f79 Mon Sep 17 00:00:00 2001 From: braydonk Date: Fri, 10 Jan 2025 16:40:57 +0000 Subject: [PATCH 3/7] add /proc/pid/comm to attribute description --- .chloggen/process_name.yaml | 5 +++-- model/process/registry.yaml | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.chloggen/process_name.yaml b/.chloggen/process_name.yaml index c35e90f3eb..36fa8b0fa0 100644 --- a/.chloggen/process_name.yaml +++ b/.chloggen/process_name.yaml @@ -21,5 +21,6 @@ issues: [1736] # Use pipe (|) for multiline entries. subtext: | The new `process.name` attribute uses the original guidance for `process.executable.name`, - suggesting use of the `Name` field from `/proc/[pid]/status` on Linux. `process.executable.name` - guidance now suggests using the base name from the `/proc/[pid]/exe` symlink's target path. + suggesting use of `/proc/[pid]/comm` or the `Name` field from `/proc/[pid]/status` on Linux. + `process.executable.name` guidance now suggests using the base name from the `/proc/[pid]/exe` + symlink's target path. diff --git a/model/process/registry.yaml b/model/process/registry.yaml index 33159a0288..2c4f28c401 100644 --- a/model/process/registry.yaml +++ b/model/process/registry.yaml @@ -15,9 +15,9 @@ groups: type: string stability: experimental brief: > - The name of the process. 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`. + The name of the process. On Linux based systems, can be set to + the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status`. + On Windows, can be set to the base name of `GetProcessImageFileNameW`. examples: ['otelcol'] - id: process.parent_pid type: int From bb51157895b749c79ca332e2a8c08d553fbbabe9 Mon Sep 17 00:00:00 2001 From: braydonk Date: Fri, 10 Jan 2025 16:45:52 +0000 Subject: [PATCH 4/7] generate from registry.yaml changes --- docs/attributes-registry/process.md | 3 ++- docs/cli/cli-spans.md | 4 ++-- docs/resource/process.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 4ba9cdb3aa..e650fb7f49 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -25,12 +25,13 @@ An operating system process. | `process.executable.build_id.gnu` | string | The GNU build ID as found in the `.note.gnu.build-id` ELF section (hex string). | `c89b11207f6479603b0d49bf291c092c2b719293` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.build_id.go` | string | The Go build ID as retrieved by `go tool buildid `. | `foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.build_id.htlhash` | string | Profiling specific build ID for executables. See the OTel specification for Profiles for more information. | `600DCAFE4A110000F2BF38C493F5FB92` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `process.executable.name` | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.executable.name` | string | The name of the process executable. On Linux based systems, can be set to the base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.path` | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.exit.code` | int | The exit code of the process. | `127` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.exit.time` | string | The date and time the process exited, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.group_leader.pid` | int | The PID of the process's group leader. This is also the process group ID (PGID) of the process. | `23` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.name` | string | The name of the process. On Linux based systems, can be set to the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.owner` | string | The username of the user that owns the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.paging.fault_type` | string | The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. | `major`; `minor` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/cli/cli-spans.md b/docs/cli/cli-spans.md index be7e2a61b8..8574fe60f4 100644 --- a/docs/cli/cli-spans.md +++ b/docs/cli/cli-spans.md @@ -28,7 +28,7 @@ Span status SHOULD be set to `Error` if `{process.exit.code}` is not 0. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`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` | `Required` | ![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 base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.exit.code`](/docs/attributes-registry/process.md) | int | The exit code of the process. | `127` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if and only if process.exit.code is not 0 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -79,7 +79,7 @@ it's RECOMMENDED to: | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`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` | `Required` | ![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 base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.exit.code`](/docs/attributes-registry/process.md) | int | The exit code of the process. | `127` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if and only if process.exit.code is not 0 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/resource/process.md b/docs/resource/process.md index 87689be8bd..b6bc83d965 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -40,7 +40,7 @@ | [`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.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the base name of the target of `/proc/[pid]/exe`. 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.linux.cgroup`](/docs/attributes-registry/process.md) | string | The control group associated with the process. [6] | `1:name=systemd:/user.slice/user-1000.slice/session-3.scope`; `0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope` | `Recommended` | ![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) | From cd4c3357d8325b865b3221e9236b14169226834b Mon Sep 17 00:00:00 2001 From: braydonk Date: Sat, 11 Jan 2025 14:33:06 +0000 Subject: [PATCH 5/7] add note about process.name on Linux vs Windows --- model/process/registry.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/model/process/registry.yaml b/model/process/registry.yaml index 2c4f28c401..8c84659b15 100644 --- a/model/process/registry.yaml +++ b/model/process/registry.yaml @@ -15,9 +15,17 @@ groups: type: string stability: experimental brief: > - The name of the process. On Linux based systems, can be set to - the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status`. - On Windows, can be set to the base name of `GetProcessImageFileNameW`. + The name of the process. On Linux based systems, this SHOULD be set to + the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status` + (these values are equivalent). On Windows, this SHOULD be set to the + base name of `GetProcessImageFileNameW`. + note:: > + The value of this attribute will be equivalent to `process.executable.name` + on Windows, but may not be on Linux. On Linux, the process name from `/proc/[pid]/comm` + is truncated if its name is longer than `TASK_COMM_LEN`-1, and it can be manually + changed by the process itself via [`prctl(2)`](https://man7.org/linux/man-pages/man2/prctl.2.html). + On Windows, it won't be necessary to have both `process.name` and `process.executable.name`, but + it may be on Linux depending on your use case. examples: ['otelcol'] - id: process.parent_pid type: int @@ -72,9 +80,9 @@ groups: type: string stability: experimental brief: > - The name of the process executable. On Linux based systems, can be set - to the base name of the target of `/proc/[pid]/exe`. On Windows, - can be set to the base name of `GetProcessImageFileNameW`. + The name of the process executable. On Linux based systems, this SHOULD be + set to the base name of the target of `/proc/[pid]/exe`. On Windows, + this SHOULD be set to the base name of `GetProcessImageFileNameW`. examples: ['otelcol'] - id: process.executable.path type: string From 32ee3f4f02dc8d42dbf72b814e2fff69d43f3fe6 Mon Sep 17 00:00:00 2001 From: braydonk Date: Sat, 11 Jan 2025 14:36:49 +0000 Subject: [PATCH 6/7] did table-generation --- docs/cli/cli-spans.md | 4 ++-- docs/resource/process.md | 2 +- model/process/registry.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cli/cli-spans.md b/docs/cli/cli-spans.md index 8574fe60f4..0f5311082f 100644 --- a/docs/cli/cli-spans.md +++ b/docs/cli/cli-spans.md @@ -28,7 +28,7 @@ Span status SHOULD be set to `Error` if `{process.exit.code}` is not 0. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![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, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.exit.code`](/docs/attributes-registry/process.md) | int | The exit code of the process. | `127` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if and only if process.exit.code is not 0 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | @@ -79,7 +79,7 @@ it's RECOMMENDED to: | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![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, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.exit.code`](/docs/attributes-registry/process.md) | int | The exit code of the process. | `127` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if and only if process.exit.code is not 0 | ![Stable](https://img.shields.io/badge/-stable-lightgreen) | diff --git a/docs/resource/process.md b/docs/resource/process.md index b6bc83d965..f2998eaa0e 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -40,7 +40,7 @@ | [`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 base name of the target of `/proc/[pid]/exe`. 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.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD 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.linux.cgroup`](/docs/attributes-registry/process.md) | string | The control group associated with the process. [6] | `1:name=systemd:/user.slice/user-1000.slice/session-3.scope`; `0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope` | `Recommended` | ![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) | diff --git a/model/process/registry.yaml b/model/process/registry.yaml index 8c84659b15..edc1ca2516 100644 --- a/model/process/registry.yaml +++ b/model/process/registry.yaml @@ -19,7 +19,7 @@ groups: the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status` (these values are equivalent). On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. - note:: > + note: > The value of this attribute will be equivalent to `process.executable.name` on Windows, but may not be on Linux. On Linux, the process name from `/proc/[pid]/comm` is truncated if its name is longer than `TASK_COMM_LEN`-1, and it can be manually From 5630937f494c59652ced3d97e2a22b0f93e447ef Mon Sep 17 00:00:00 2001 From: braydonk Date: Sat, 11 Jan 2025 14:38:03 +0000 Subject: [PATCH 7/7] make attribute-registry-generation --- docs/attributes-registry/process.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index e650fb7f49..9307c4225d 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -25,13 +25,13 @@ An operating system process. | `process.executable.build_id.gnu` | string | The GNU build ID as found in the `.note.gnu.build-id` ELF section (hex string). | `c89b11207f6479603b0d49bf291c092c2b719293` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.build_id.go` | string | The Go build ID as retrieved by `go tool buildid `. | `foh3mEXu7BLZjsN9pOwG/kATcXlYVCDEFouRMQed_/WwRFB1hPo9LBkekthSPG/x8hMC8emW2cCjXD0_1aY` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.build_id.htlhash` | string | Profiling specific build ID for executables. See the OTel specification for Profiles for more information. | `600DCAFE4A110000F2BF38C493F5FB92` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `process.executable.name` | string | The name of the process executable. On Linux based systems, can be set to the base name of the target of `/proc/[pid]/exe`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.executable.name` | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.executable.path` | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.exit.code` | int | The exit code of the process. | `127` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.exit.time` | string | The date and time the process exited, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.group_leader.pid` | int | The PID of the process's group leader. This is also the process group ID (PGID) of the process. | `23` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `process.name` | string | The name of the process. On Linux based systems, can be set to the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.name` | string | The name of the process. On Linux based systems, this SHOULD be set to the value of `/proc/[pid]/comm` or to the `Name` field in `proc/[pid]/status` (these values are equivalent). On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. [2] | `otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.owner` | string | The username of the user that owns the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.paging.fault_type` | string | The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. | `major`; `minor` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -44,17 +44,19 @@ 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.title` | string | Process title (proctitle) [2] | `cat /etc/hostname`; `xfce4-session`; `bash` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.title` | string | Process title (proctitle) [3] | `cat /etc/hostname`; `xfce4-session`; `bash` | ![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. [3] | `12` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.vpid` | int | Virtual process identifier. [4] | `12` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.working_directory` | string | The working directory of the process. | `/root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1] `process.args_count`:** This field can be useful for querying or performing bucket analysis on how many arguments were provided to start a process. More arguments may be an indication of suspicious activity. -**[2] `process.title`:** In many Unix-like systems, process title (proctitle), is the string that represents the name or command line of a running process, displayed by system monitoring tools like ps, top, and htop. +**[2] `process.name`:** The value of this attribute will be equivalent to `process.executable.name` on Windows, but may not be on Linux. On Linux, the process name from `/proc/[pid]/comm` is truncated if its name is longer than `TASK_COMM_LEN`-1, and it can be manually changed by the process itself via [`prctl(2)`](https://man7.org/linux/man-pages/man2/prctl.2.html). On Windows, it won't be necessary to have both `process.name` and `process.executable.name`, but it may be on Linux depending on your use case. -**[3] `process.vpid`:** The process ID within a PID namespace. This is not necessarily unique across all processes on the host but it is unique within the process namespace that the process exists within. +**[3] `process.title`:** In many Unix-like systems, process title (proctitle), is the string that represents the name or command line of a running process, displayed by system monitoring tools like ps, top, and htop. + +**[4] `process.vpid`:** The process ID within a PID namespace. This is not necessarily unique across all processes on the host but it is unique within the process namespace that the process exists within. --- @@ -80,9 +82,9 @@ Describes Linux Process attributes | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `process.linux.cgroup` | string | The control group associated with the process. [4] | `1:name=systemd:/user.slice/user-1000.slice/session-3.scope`; `0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.linux.cgroup` | string | The control group associated with the process. [5] | `1:name=systemd:/user.slice/user-1000.slice/session-3.scope`; `0::/user.slice/user-1000.slice/user@1000.service/tmux-spawn-0267755b-4639-4a27-90ed-f19f88e53748.scope` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[4] `process.linux.cgroup`:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the path(s) to the cgroup(s) associated with the process, which should match the contents of the [/proc/\[PID\]/cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. +**[5] `process.linux.cgroup`:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the path(s) to the cgroup(s) associated with the process, which should match the contents of the [/proc/\[PID\]/cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. ## Deprecated Process Attributes