From 4afb2580d7e405d06f9b64a9c164b03ecedc2d92 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 21 Nov 2023 13:01:32 -0800 Subject: [PATCH 01/16] Add additional fields to process attribute registry Add additional fields, based on the POSIX process model, to the process attribute registry --- docs/attributes-registry/process.md | 12 +++++- model/registry/process.yaml | 67 +++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index edef9364bd..74363d06bd 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -11,12 +11,22 @@ | `process.command` | 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` | | `process.command_args` | 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]` | | `process.command_line` | 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"` | +| `process.effective_user.id` | int | The effective user ID (EUID) of the process. | `1001` | +| `process.end` | string | The time the process ended. | `2023-11-21T09:26:12.315Z` | | `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` | | `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` | +| `process.exit_code` | int | The exit code of the process. | `127` | +| `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` | +| `process.interactive` | boolean | Whether the process is connected to an interactive shell. | `true` | | `process.owner` | string | The username of the user that owns the process. | `root` | -| `process.parent_pid` | int | Parent Process identifier (PID). | `111` | +| `process.parent.pid` | int | Parent Process identifier (PID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | +| `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | | `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | | `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | | `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | +| `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | +| `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | +| `process.start` | string | The time the process started. | `2023-11-21T09:25:34.853Z` | +| `process.vpid` | int | Virtual process identifier. The process PID 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. | `12` | diff --git a/model/registry/process.yaml b/model/registry/process.yaml index dd26c09b77..4dae01b85c 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -10,11 +10,32 @@ groups: brief: > Process identifier (PID). examples: [1234] - - id: parent_pid + - id: parent.pid type: int brief: > - Parent Process identifier (PID). + Parent Process identifier (PPID). examples: [111] + - id: vpid + type: int + brief: > + Virtual process identifier. + note: > + The process PID 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. + examples: [12] + - id: session_leader.pid + type: int + brief: > + The PID of the process's session leader. This is also the session ID + (SID) of the process. + examples: [14] + - id: group_leader.pid + type: int + brief: > + The PID of the process's group leader. This is also the process group + ID (PGID) of the process. + examples: [23] - id: executable.name type: string brief: > @@ -57,7 +78,27 @@ groups: type: string brief: > The username of the user that owns the process. - examples: 'root' + note: > + This is intended to be used with Windows only. On POSIX systems, processes + can have multiple owners (effective, real and saved). To avoid confusion + about which owner is being referenced, this field should not be used with + POSIX systems. + examples: ['root'] + - id: real_user.id + type: int + brief: > + The real user ID (RUID) of the process. + examples: [1000] + - id: effective_user.id + type: int + brief: > + The effective user ID (EUID) of the process. + examples: [1001] + - id: saved_user.id + type: int + brief: > + The saved user ID (SUID) of the process. + examples: [1002] - id: runtime.name type: string brief: > @@ -76,3 +117,23 @@ groups: An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' + - id: start + type: string + brief: > + The time the process started. + examples: ['2023-11-21T09:25:34.853Z'] + - id: end + type: string + brief: > + The time the process ended. + examples: ['2023-11-21T09:26:12.315Z'] + - id: exit_code + type: int + brief: > + The exit code of the process. + examples: [127] + - id: interactive + type: boolean + brief: > + Whether the process is connected to an interactive shell. + examples: [true] From a25b46385e8b4778036af374466dfb92b135eaf0 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 21 Nov 2023 13:32:23 -0800 Subject: [PATCH 02/16] Update field descriptions --- model/registry/process.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 4dae01b85c..4f37ed1dc9 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -20,7 +20,7 @@ groups: brief: > Virtual process identifier. note: > - The process PID within a PID namespace. This is not necessarily unique + 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. examples: [12] @@ -80,8 +80,8 @@ groups: The username of the user that owns the process. note: > This is intended to be used with Windows only. On POSIX systems, processes - can have multiple owners (effective, real and saved). To avoid confusion - about which owner is being referenced, this field should not be used with + can have multiple users (effective, real and saved). To avoid confusion + about which user is being referenced, this field should not be used with POSIX systems. examples: ['root'] - id: real_user.id From e388e84faaff007f22c15852e68a5b50513f6f87 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Thu, 23 Nov 2023 14:25:49 -0800 Subject: [PATCH 03/16] Update process schema Update documentation, add some more fields (env_vars, usernames). --- docs/attributes-registry/process.md | 24 +++++++++++++------ docs/resource/process.md | 6 +++-- model/registry/process.yaml | 36 +++++++++++++++++++++++------ model/resource/process.yaml | 2 +- 4 files changed, 51 insertions(+), 17 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 74363d06bd..7b9dd83193 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -11,22 +11,32 @@ | `process.command` | 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` | | `process.command_args` | 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]` | | `process.command_line` | 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"` | -| `process.effective_user.id` | int | The effective user ID (EUID) of the process. | `1001` | -| `process.end` | string | The time the process ended. | `2023-11-21T09:26:12.315Z` | +| `process.end` | string | The date and time the process ended. | `2023-11-21T09:26:12.315Z` | +| `process.env_vars` | string[] | Array of environment variable bindings. [1] | `[PATH=/usr/local/bin;/usr/bin, USER=ubuntu]` | | `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` | | `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` | | `process.exit_code` | int | The exit code of the process. | `127` | | `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` | -| `process.interactive` | boolean | Whether the process is connected to an interactive shell. | `true` | -| `process.owner` | string | The username of the user that owns the process. | `root` | -| `process.parent.pid` | int | Parent Process identifier (PID). | `111` | +| `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | +| `process.owner` | string | The username of the user that owns the process. [2] | `root` | +| `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | | `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | +| `process.real_user.name` | string | The username of the real user of the process. | `operator` | | `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | | `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | | `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | | `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | +| `process.saved_user.name` | string | The username of the saved user. | `operator` | | `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | -| `process.start` | string | The time the process started. | `2023-11-21T09:25:34.853Z` | -| `process.vpid` | int | Virtual process identifier. The process PID 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. | `12` | +| `process.start` | string | The date and time the process started. | `2023-11-21T09:25:34.853Z` | +| `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | +| `process.user.name` | string | The username of the effective user of the process. | `root` | +| `process.vpid` | int | Virtual process identifier. [3] | `12` | + +**[1]:** As environment variables may change during a process's lifespan, this should be captured as a snapshot when the event occurred. + +**[2]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. + +**[3]:** 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. diff --git a/docs/resource/process.md b/docs/resource/process.md index b3817f34df..58b2ee7249 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -32,10 +32,12 @@ | [`process.command_line`](../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: See alternative attributes below. | | [`process.executable.name`](../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: See alternative attributes below. | | [`process.executable.path`](../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: See alternative attributes below. | -| [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | Recommended | -| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PID). | `111` | Recommended | +| [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. [1] | `root` | Recommended | +| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | Recommended | +**[1]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. + **Additional attribute requirements:** At least one of the following sets of attributes is required: * [`process.executable.name`](../attributes-registry/process.md) diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 4f37ed1dc9..09ebd3e755 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -74,6 +74,14 @@ groups: null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. examples: ['cmd/otecol', '--config=config.yaml'] + - id: env_vars + type: string[] + brief: > + Array of environment variable bindings. + note: > + As environment variables may change during a process's lifespan, this should be + captured as a snapshot when the event occurred. + examples: ['PATH=/usr/local/bin;/usr/bin', 'USER=ubuntu'] - id: owner type: string brief: > @@ -84,21 +92,36 @@ groups: about which user is being referenced, this field should not be used with POSIX systems. examples: ['root'] + - id: user.id + type: int + brief: > + The effective user ID (EUID) of the process. + examples: [1001] + - id: user.name + type: string + brief: > + The username of the effective user of the process. + examples: ['root'] - id: real_user.id type: int brief: > The real user ID (RUID) of the process. examples: [1000] - - id: effective_user.id - type: int + - id: real_user.name + type: string brief: > - The effective user ID (EUID) of the process. - examples: [1001] + The username of the real user of the process. + examples: ['operator'] - id: saved_user.id type: int brief: > The saved user ID (SUID) of the process. examples: [1002] + - id: saved_user.name + type: string + brief: > + The username of the saved user. + examples: ['operator'] - id: runtime.name type: string brief: > @@ -120,12 +143,12 @@ groups: - id: start type: string brief: > - The time the process started. + The date and time the process started. examples: ['2023-11-21T09:25:34.853Z'] - id: end type: string brief: > - The time the process ended. + The date and time the process ended. examples: ['2023-11-21T09:26:12.315Z'] - id: exit_code type: int @@ -136,4 +159,3 @@ groups: type: boolean brief: > Whether the process is connected to an interactive shell. - examples: [true] diff --git a/model/resource/process.yaml b/model/resource/process.yaml index 61223d61ce..e4cfb190e7 100644 --- a/model/resource/process.yaml +++ b/model/resource/process.yaml @@ -6,7 +6,7 @@ groups: An operating system process. attributes: - ref: process.pid - - ref: process.parent_pid + - ref: process.parent.pid - ref: process.executable.name requirement_level: conditionally_required: See alternative attributes below. From a98e855182d41bdf1066dd3d0bb8ab8e0d5f3953 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Mon, 27 Nov 2023 16:44:28 -0800 Subject: [PATCH 04/16] Specify ISO 8601 format for start, end fields --- docs/attributes-registry/process.md | 6 +++--- docs/resource/process.md | 2 +- model/registry/process.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 7b9dd83193..969bb6dc5f 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -11,7 +11,7 @@ | `process.command` | 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` | | `process.command_args` | 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]` | | `process.command_line` | 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"` | -| `process.end` | string | The date and time the process ended. | `2023-11-21T09:26:12.315Z` | +| `process.end` | string | The date and time the process ended, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | | `process.env_vars` | string[] | Array of environment variable bindings. [1] | `[PATH=/usr/local/bin;/usr/bin, USER=ubuntu]` | | `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` | | `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` | @@ -19,7 +19,7 @@ | `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` | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | | `process.owner` | string | The username of the user that owns the process. [2] | `root` | -| `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | +| `process.parent.pid` | int | Parent Process identifier (PPID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | | `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | | `process.real_user.name` | string | The username of the real user of the process. | `operator` | @@ -29,7 +29,7 @@ | `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | | `process.saved_user.name` | string | The username of the saved user. | `operator` | | `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | -| `process.start` | string | The date and time the process started. | `2023-11-21T09:25:34.853Z` | +| `process.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | | `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | | `process.user.name` | string | The username of the effective user of the process. | `root` | | `process.vpid` | int | Virtual process identifier. [3] | `12` | diff --git a/docs/resource/process.md b/docs/resource/process.md index 58b2ee7249..75aeb4ae77 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -33,7 +33,7 @@ | [`process.executable.name`](../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: See alternative attributes below. | | [`process.executable.path`](../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: See alternative attributes below. | | [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. [1] | `root` | Recommended | -| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | +| [`process.parent.pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | Recommended | **[1]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 09ebd3e755..c91c4a7126 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -143,12 +143,12 @@ groups: - id: start type: string brief: > - The date and time the process started. + The date and time the process started, in ISO 8601 format. examples: ['2023-11-21T09:25:34.853Z'] - id: end type: string brief: > - The date and time the process ended. + The date and time the process ended, in ISO 8601 format. examples: ['2023-11-21T09:26:12.315Z'] - id: exit_code type: int From 2910bc0d42ee4858c97d68206c2fa1b03a698871 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 28 Nov 2023 11:22:48 -0800 Subject: [PATCH 05/16] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e27d9b938e..55cda481b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ release. ([#536](https://github.com/open-telemetry/semantic-conventions/pull/536)) - BREAKING: Change `event.name` definition to include `namespace` and remove `event.domain` from log event attributes. ([#473](https://github.com/open-telemetry/semantic-conventions/pull/473)) +- Rename `process.parent_pid` to `process.parent.pid` in process resource and registry. + ([#564](https://github.com/open-telemetry/semantic-conventions/pull/564)) ### Features @@ -33,6 +35,8 @@ release. ([#21](https://github.com/open-telemetry/semantic-conventions/pull/21)) - Add `messaging.gcp_pubsub.message.ordering_key` attribute. ([#528](https://github.com/open-telemetry/semantic-conventions/pull/528)) +- Add additional attributes to process attribute registry. + ([#564](https://github.com/open-telemetry/semantic-conventions/pull/564)) ### Fixes From 4ceb5f6acc58b3c351634787cd3c6e0aaa0ddda2 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 28 Nov 2023 12:36:42 -0800 Subject: [PATCH 06/16] Update schema-next.yaml --- schema-next.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/schema-next.yaml b/schema-next.yaml index ae84e381af..0d877f7bb4 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -6,6 +6,12 @@ versions: - rename_metrics: jvm.memory.usage: jvm.memory.used jvm.memory.usage_after_last_gc: jvm.memory.used_after_last_gc + resources: + changes: + # https://github.com/open-telemetry/semantic-conventions/pull/564 + - rename_attributes: + attribute_map: + process.parent_pid: process.parent.pid 1.23.0: metrics: changes: From d38dceca982e436886c6cd7d0a8f330756fef616 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Thu, 7 Dec 2023 11:26:28 -0800 Subject: [PATCH 07/16] Revert rename of parent_pid Reverting the breaking change of renaming `parent_pid` to `parent.pid`. Also, add a line about filtering sensitive info to the process.env_var definition. --- CHANGELOG.md | 2 -- docs/attributes-registry/process.md | 3 ++- docs/resource/process.md | 2 +- model/registry/process.yaml | 4 +++- model/resource/process.yaml | 2 +- schema-next.yaml | 4 ---- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 847bef54f2..5aef93ba28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,6 @@ release. ([#536](https://github.com/open-telemetry/semantic-conventions/pull/536)) - BREAKING: Change `event.name` definition to include `namespace` and remove `event.domain` from log event attributes. ([#473](https://github.com/open-telemetry/semantic-conventions/pull/473)) -- Rename `process.parent_pid` to `process.parent.pid` in process resource and registry. - ([#564](https://github.com/open-telemetry/semantic-conventions/pull/564)) - BREAKING: Change `system.disk.io.direction` and `system.network.io.direction` to global attributes `disk.io.direction` and `network.io.direction` ([#530](https://github.com/open-telemetry/semantic-conventions/pull/530)) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 969bb6dc5f..1e77c3cc25 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -19,7 +19,7 @@ | `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` | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | | `process.owner` | string | The username of the user that owns the process. [2] | `root` | -| `process.parent.pid` | int | Parent Process identifier (PPID). | `111` | +| `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | | `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | | `process.real_user.name` | string | The username of the real user of the process. | `operator` | @@ -35,6 +35,7 @@ | `process.vpid` | int | Virtual process identifier. [3] | `12` | **[1]:** As environment variables may change during a process's lifespan, this should be captured as a snapshot when the event occurred. +May be filtered to protect sensitive information. **[2]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. diff --git a/docs/resource/process.md b/docs/resource/process.md index f197764da3..74b86e0abc 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -33,7 +33,7 @@ | [`process.executable.name`](../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: See alternative attributes below. | | [`process.executable.path`](../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: See alternative attributes below. | | [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. [1] | `root` | Recommended | -| [`process.parent.pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | +| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | Recommended | **[1]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index c91c4a7126..beba0654e9 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -10,7 +10,7 @@ groups: brief: > Process identifier (PID). examples: [1234] - - id: parent.pid + - id: parent_pid type: int brief: > Parent Process identifier (PPID). @@ -81,6 +81,8 @@ groups: note: > As environment variables may change during a process's lifespan, this should be captured as a snapshot when the event occurred. + + May be filtered to protect sensitive information. examples: ['PATH=/usr/local/bin;/usr/bin', 'USER=ubuntu'] - id: owner type: string diff --git a/model/resource/process.yaml b/model/resource/process.yaml index e4cfb190e7..61223d61ce 100644 --- a/model/resource/process.yaml +++ b/model/resource/process.yaml @@ -6,7 +6,7 @@ groups: An operating system process. attributes: - ref: process.pid - - ref: process.parent.pid + - ref: process.parent_pid - ref: process.executable.name requirement_level: conditionally_required: See alternative attributes below. diff --git a/schema-next.yaml b/schema-next.yaml index 48ada8235c..834bff8780 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -11,10 +11,6 @@ versions: attribute_map: system.network.io.direction: network.io.direction system.disk.io.direction: disk.io.direction - # https://github.com/open-telemetry/semantic-conventions/pull/564 - - rename_attributes: - attribute_map: - process.parent_pid: process.parent.pid 1.23.0: metrics: changes: From e2d4e36b7f20e3aa0bf84778b2ae9e210f34dd59 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Thu, 7 Dec 2023 14:24:38 -0800 Subject: [PATCH 08/16] Remove note on usage of process.owner --- docs/attributes-registry/process.md | 8 +++----- docs/resource/process.md | 4 +--- model/registry/process.yaml | 5 ----- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 1e77c3cc25..5e2016ee7a 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -18,7 +18,7 @@ | `process.exit_code` | int | The exit code of the process. | `127` | | `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` | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | -| `process.owner` | string | The username of the user that owns the process. [2] | `root` | +| `process.owner` | string | The username of the user that owns the process. | `root` | | `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | | `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | @@ -32,12 +32,10 @@ | `process.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | | `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | | `process.user.name` | string | The username of the effective user of the process. | `root` | -| `process.vpid` | int | Virtual process identifier. [3] | `12` | +| `process.vpid` | int | Virtual process identifier. [2] | `12` | **[1]:** As environment variables may change during a process's lifespan, this should be captured as a snapshot when the event occurred. May be filtered to protect sensitive information. -**[2]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. - -**[3]:** 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. +**[2]:** 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. diff --git a/docs/resource/process.md b/docs/resource/process.md index 74b86e0abc..8156fbcd2a 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -32,12 +32,10 @@ | [`process.command_line`](../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: See alternative attributes below. | | [`process.executable.name`](../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: See alternative attributes below. | | [`process.executable.path`](../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: See alternative attributes below. | -| [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. [1] | `root` | Recommended | +| [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | Recommended | | [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | Recommended | -**[1]:** This is intended to be used with Windows only. On POSIX systems, processes can have multiple users (effective, real and saved). To avoid confusion about which user is being referenced, this field should not be used with POSIX systems. - **Additional attribute requirements:** At least one of the following sets of attributes is required: * [`process.executable.name`](../attributes-registry/process.md) diff --git a/model/registry/process.yaml b/model/registry/process.yaml index beba0654e9..7f70dd779b 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -88,11 +88,6 @@ groups: type: string brief: > The username of the user that owns the process. - note: > - This is intended to be used with Windows only. On POSIX systems, processes - can have multiple users (effective, real and saved). To avoid confusion - about which user is being referenced, this field should not be used with - POSIX systems. examples: ['root'] - id: user.id type: int From 7b7a5180395a1454e49c49d6b512b2f3473997a7 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Thu, 7 Dec 2023 14:39:02 -0800 Subject: [PATCH 09/16] Revert change to PPID description --- docs/attributes-registry/process.md | 2 +- docs/resource/process.md | 2 +- model/registry/process.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 5e2016ee7a..f41193cebe 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -19,7 +19,7 @@ | `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` | | `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | | `process.owner` | string | The username of the user that owns the process. | `root` | -| `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | +| `process.parent_pid` | int | Parent Process identifier (PID). | `111` | | `process.pid` | int | Process identifier (PID). | `1234` | | `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | | `process.real_user.name` | string | The username of the real user of the process. | `operator` | diff --git a/docs/resource/process.md b/docs/resource/process.md index 8156fbcd2a..fb6a3a58f2 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -33,7 +33,7 @@ | [`process.executable.name`](../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: See alternative attributes below. | | [`process.executable.path`](../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: See alternative attributes below. | | [`process.owner`](../attributes-registry/process.md) | string | The username of the user that owns the process. | `root` | Recommended | -| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | Recommended | +| [`process.parent_pid`](../attributes-registry/process.md) | int | Parent Process identifier (PID). | `111` | Recommended | | [`process.pid`](../attributes-registry/process.md) | int | Process identifier (PID). | `1234` | Recommended | **Additional attribute requirements:** At least one of the following sets of attributes is required: diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 7f70dd779b..d13cc91427 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -13,7 +13,7 @@ groups: - id: parent_pid type: int brief: > - Parent Process identifier (PPID). + Parent Process identifier (PID). examples: [111] - id: vpid type: int From 14ffaa099a3e70dd227afb2ae4ab9ebfd234e4fc Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 12 Dec 2023 10:49:18 -0800 Subject: [PATCH 10/16] Change env_vars description to SHOULD filter Change the env_vars description to state filtering SHOULD be done --- docs/attributes-registry/process.md | 4 ++-- model/registry/process.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index f41193cebe..7b735bb8e9 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -34,8 +34,8 @@ | `process.user.name` | string | The username of the effective user of the process. | `root` | | `process.vpid` | int | Virtual process identifier. [2] | `12` | -**[1]:** As environment variables may change during a process's lifespan, this should be captured as a snapshot when the event occurred. -May be filtered to protect sensitive information. +**[1]:** As environment variables may change during a process's lifespan, this SHOULD be captured as a snapshot when the event occurred. +This SHOULD be filtered to protect sensitive information. **[2]:** 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. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index d13cc91427..90ea920351 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -79,10 +79,10 @@ groups: brief: > Array of environment variable bindings. note: > - As environment variables may change during a process's lifespan, this should be + As environment variables may change during a process's lifespan, this SHOULD be captured as a snapshot when the event occurred. - May be filtered to protect sensitive information. + This SHOULD be filtered to protect sensitive information. examples: ['PATH=/usr/local/bin;/usr/bin', 'USER=ubuntu'] - id: owner type: string From edf0aa3c8ba964a59b60a091ca5a5daafbc07e7d Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Mon, 29 Jan 2024 10:42:23 -0800 Subject: [PATCH 11/16] Remove env_vars from process schema There are some open questions around env_vars, so removing from this branch. --- docs/attributes-registry/process.md | 8 ++------ model/registry/process.yaml | 10 ---------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index b807c60b00..ee70a05692 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -12,7 +12,6 @@ | `process.command_args` | 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]` | | `process.command_line` | 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"` | | `process.end` | string | The date and time the process ended, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | -| `process.env_vars` | string[] | Array of environment variable bindings. [1] | `[PATH=/usr/local/bin;/usr/bin, USER=ubuntu]` | | `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` | | `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` | | `process.exit_code` | int | The exit code of the process. | `127` | @@ -32,10 +31,7 @@ | `process.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | | `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | | `process.user.name` | string | The username of the effective user of the process. | `root` | -| `process.vpid` | int | Virtual process identifier. [2] | `12` | +| `process.vpid` | int | Virtual process identifier. [1] | `12` | -**[1]:** As environment variables may change during a process's lifespan, this SHOULD be captured as a snapshot when the event occurred. -This SHOULD be filtered to protect sensitive information. - -**[2]:** 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. +**[1]:** 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. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 9f37ec7ea4..7145891d73 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -74,16 +74,6 @@ groups: null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. examples: ['cmd/otecol', '--config=config.yaml'] - - id: env_vars - type: string[] - brief: > - Array of environment variable bindings. - note: > - As environment variables may change during a process's lifespan, this SHOULD be - captured as a snapshot when the event occurred. - - This SHOULD be filtered to protect sensitive information. - examples: ['PATH=/usr/local/bin;/usr/bin', 'USER=ubuntu'] - id: owner type: string brief: > From 29c99de3b7c76f75f4d9f8c274065b399bb91152 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Tue, 30 Jan 2024 10:11:49 -0800 Subject: [PATCH 12/16] Move change to unreleased section of changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7603a213b9..ea96ce3fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ release. ([#545](https://github.com/open-telemetry/semantic-conventions/pull/545)) - Add `aws.ecs.task.id` attribute, corrected description for `aws.ecs.task.arn`. ([#597](https://github.com/open-telemetry/semantic-conventions/pull/597)) +- Add additional attributes to process attribute registry. + ([#564](https://github.com/open-telemetry/semantic-conventions/pull/564)) ### Fixes @@ -82,8 +84,6 @@ release. ([#21](https://github.com/open-telemetry/semantic-conventions/pull/21)) - Add `messaging.gcp_pubsub.message.ordering_key` attribute. ([#528](https://github.com/open-telemetry/semantic-conventions/pull/528)) -- Add additional attributes to process attribute registry. - ([#564](https://github.com/open-telemetry/semantic-conventions/pull/564)) - Define how to set `process.runtime.name`, `process.runtime.version`, `process.runtime.description` for .NET runtime. ([#561](https://github.com/open-telemetry/semantic-conventions/pull/561)) From b79e2690db66637ada79d290fc26de3ec7bbcc62 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Thu, 8 Feb 2024 09:40:37 -0800 Subject: [PATCH 13/16] Add changelog entry --- .chloggen/564.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .chloggen/564.yaml diff --git a/.chloggen/564.yaml b/.chloggen/564.yaml new file mode 100644 index 0000000000..777f5f8b7b --- /dev/null +++ b/.chloggen/564.yaml @@ -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: Add additional attributes to process attribute registry + +# 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: [564] + +# (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: From 25c54a36660eeaa966a3983983ad808bf7e88b2d Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Fri, 5 Apr 2024 10:43:00 -0700 Subject: [PATCH 14/16] Add experimental stability tag to new fields --- docs/attributes-registry/process.md | 52 ++++++++++++++--------------- model/registry/process.yaml | 13 ++++++++ 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index ee70a05692..f65118d9eb 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -6,32 +6,32 @@ ## Process Attributes -| Attribute | Type | Description | Examples | -|---|---|---|---| -| `process.command` | 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` | -| `process.command_args` | 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]` | -| `process.command_line` | 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"` | -| `process.end` | string | The date and time the process ended, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | -| `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` | -| `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` | -| `process.exit_code` | int | The exit code of the process. | `127` | -| `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` | -| `process.interactive` | boolean | Whether the process is connected to an interactive shell. | | -| `process.owner` | string | The username of the user that owns the process. | `root` | -| `process.parent_pid` | int | Parent Process identifier (PPID). | `111` | -| `process.pid` | int | Process identifier (PID). | `1234` | -| `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | -| `process.real_user.name` | string | The username of the real user of the process. | `operator` | -| `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | -| `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | -| `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | -| `process.saved_user.id` | int | The saved user ID (SUID) of the process. | `1002` | -| `process.saved_user.name` | string | The username of the saved user. | `operator` | -| `process.session_leader.pid` | int | The PID of the process's session leader. This is also the session ID (SID) of the process. | `14` | -| `process.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | -| `process.user.id` | int | The effective user ID (EUID) of the process. | `1001` | -| `process.user.name` | string | The username of the effective user of the process. | `root` | -| `process.vpid` | int | Virtual process identifier. [1] | `12` | +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `process.command` | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.command_args` | 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]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.command_line` | 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"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.end` | string | The date and time the process ended, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | ![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.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.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.owner` | string | The username of the user that owns the process. | `root` | ![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) | +| `process.pid` | int | Process identifier (PID). | `1234` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.real_user.id` | int | The real user ID (RUID) of the process. | `1000` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.real_user.name` | string | The username of the real user of the process. | `operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.runtime.description` | string | An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. | `Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.runtime.name` | string | The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. | `OpenJDK Runtime Environment` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.runtime.version` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `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.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | ![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) | **[1]:** 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. diff --git a/model/registry/process.yaml b/model/registry/process.yaml index e5199c3649..0408bb8278 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -19,6 +19,7 @@ groups: examples: [111] - id: vpid type: int + stability: experimental brief: > Virtual process identifier. note: > @@ -28,12 +29,14 @@ groups: examples: [12] - id: session_leader.pid type: int + stability: experimental brief: > The PID of the process's session leader. This is also the session ID (SID) of the process. examples: [14] - id: group_leader.pid type: int + stability: experimental brief: > The PID of the process's group leader. This is also the process group ID (PGID) of the process. @@ -89,31 +92,37 @@ groups: examples: ['root'] - id: user.id type: int + stability: experimental brief: > The effective user ID (EUID) of the process. examples: [1001] - id: user.name type: string + stability: experimental brief: > The username of the effective user of the process. examples: ['root'] - id: real_user.id type: int + stability: experimental brief: > The real user ID (RUID) of the process. examples: [1000] - id: real_user.name type: string + stability: experimental brief: > The username of the real user of the process. examples: ['operator'] - id: saved_user.id type: int + stability: experimental brief: > The saved user ID (SUID) of the process. examples: [1002] - id: saved_user.name type: string + stability: experimental brief: > The username of the saved user. examples: ['operator'] @@ -140,20 +149,24 @@ groups: examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - id: start type: string + stability: experimental brief: > The date and time the process started, in ISO 8601 format. examples: ['2023-11-21T09:25:34.853Z'] - id: end type: string + stability: experimental brief: > The date and time the process ended, in ISO 8601 format. examples: ['2023-11-21T09:26:12.315Z'] - id: exit_code type: int + stability: experimental brief: > The exit code of the process. examples: [127] - id: interactive type: boolean + stability: experimental brief: > Whether the process is connected to an interactive shell. From 5773996700041cb2340736c3d85c1bd88ca45182 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Fri, 5 Apr 2024 11:01:11 -0700 Subject: [PATCH 15/16] Use namespaces to group process creation and exit fields --- CHANGELOG.md | 1 + docs/attributes-registry/process.md | 6 +++--- model/registry/process.yaml | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e1071d8e6..d9065bafa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ # Changelog + ## Unreleased ### Breaking diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index f65118d9eb..0d0e005b66 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -11,10 +11,11 @@ | `process.command` | 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` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_args` | 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]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_line` | 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"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `process.end` | string | The date and time the process ended, in ISO 8601 format. | `2023-11-21T09:26:12.315Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.creation.time` | string | The date and time the process was created, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | ![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.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.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.owner` | string | The username of the user that owns the process. | `root` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -28,7 +29,6 @@ | `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.start` | string | The date and time the process started, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` | ![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) | diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 0408bb8278..bccb070551 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -147,19 +147,19 @@ groups: An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - - id: start + - id: creation.time type: string stability: experimental brief: > - The date and time the process started, in ISO 8601 format. + The date and time the process was created, in ISO 8601 format. examples: ['2023-11-21T09:25:34.853Z'] - - id: end + - id: exit.time type: string stability: experimental brief: > - The date and time the process ended, in ISO 8601 format. + The date and time the process exited, in ISO 8601 format. examples: ['2023-11-21T09:26:12.315Z'] - - id: exit_code + - id: exit.code type: int stability: experimental brief: > From 8280d52e5935e0551c59466e5f4af654cf980085 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Fri, 5 Apr 2024 11:18:53 -0700 Subject: [PATCH 16/16] Undo change to CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9065bafa9..7e1071d8e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ # Changelog - ## Unreleased ### Breaking