From c46b6811f0b64935a4e7b8b2f7b6336977b0eadc Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 23 Aug 2024 20:35:22 +0200 Subject: [PATCH 1/7] feat: add linux.process.cgroup attribute --- docs/attributes-registry/linux.md | 13 +++++++++++++ model/linux/registry.yaml | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/docs/attributes-registry/linux.md b/docs/attributes-registry/linux.md index cf817efa8e..bddf650728 100644 --- a/docs/attributes-registry/linux.md +++ b/docs/attributes-registry/linux.md @@ -6,6 +6,9 @@ # Linux +- [Linux Memory Attributes](#linux-memory-attributes) +- [Linux Process Attributes](#linux-process-attributes) + ## Linux Memory Attributes Describes Linux Memory attributes @@ -20,3 +23,13 @@ Describes Linux Memory attributes | --------------- | ------------- | ---------------------------------------------------------------- | | `reclaimable` | reclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `unreclaimable` | unreclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Linux Process Attributes + +Describes Linux Process attributes + +| Attribute | Type | Description | Examples | Stability | +| ---------------------- | ------ | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | + +**[1]:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the cgroup(s) path that the process belongs to. diff --git a/model/linux/registry.yaml b/model/linux/registry.yaml index a3bf3f1554..0bf4dc4d43 100644 --- a/model/linux/registry.yaml +++ b/model/linux/registry.yaml @@ -16,3 +16,15 @@ groups: stability: experimental brief: "The Linux Slab memory state" examples: ["reclaimable", "unreclaimable"] + # linux.process.* attribute group + - id: registry.linux.process + type: attribute_group + brief: "Describes Linux Process attributes" + attributes: + - id: linux.process.cgroup + type: string + stability: experimental + brief: The control group associated with the process. + examples: ["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"] + note: > + Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the cgroup(s) path that the process belongs to. From 67c412f45f54f5f0cfddd194c20152bb13439043 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 23 Aug 2024 20:37:53 +0200 Subject: [PATCH 2/7] docs: add changelog entry --- .chloggen/add_process_cgroup.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .chloggen/add_process_cgroup.yaml diff --git a/.chloggen/add_process_cgroup.yaml b/.chloggen/add_process_cgroup.yaml new file mode 100755 index 0000000000..5f32a6ac9c --- /dev/null +++ b/.chloggen/add_process_cgroup.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: linux + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add linux.process.cgroup attribute + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1357] + +# (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 b4a055ae16d2f035a276b032750b5a008203da98 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 25 Oct 2024 10:12:25 +0200 Subject: [PATCH 3/7] fix: attribute table generation --- docs/attributes-registry/linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/attributes-registry/linux.md b/docs/attributes-registry/linux.md index c54629b312..1773610eb8 100644 --- a/docs/attributes-registry/linux.md +++ b/docs/attributes-registry/linux.md @@ -28,8 +28,8 @@ Describes Linux Memory attributes Describes Linux Process attributes -| Attribute | Type | Description | Examples | Stability | -| ---------------------- | ------ | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | **[1]:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the cgroup(s) path that the process belongs to. From c75fa54d44af878e6932c15d6121c47204513ca9 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Tue, 29 Oct 2024 14:50:48 +0100 Subject: [PATCH 4/7] docs: add specific proc cgroup file --- docs/attributes-registry/linux.md | 2 +- model/linux/registry.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/attributes-registry/linux.md b/docs/attributes-registry/linux.md index 1773610eb8..81045be452 100644 --- a/docs/attributes-registry/linux.md +++ b/docs/attributes-registry/linux.md @@ -32,4 +32,4 @@ Describes Linux Process attributes |---|---|---|---|---| | `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | -**[1]:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the cgroup(s) path that the process belongs to. +**[1]:** 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. diff --git a/model/linux/registry.yaml b/model/linux/registry.yaml index 0bf4dc4d43..d42f12ca76 100644 --- a/model/linux/registry.yaml +++ b/model/linux/registry.yaml @@ -27,4 +27,4 @@ groups: brief: The control group associated with the process. examples: ["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"] note: > - Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the cgroup(s) path that the process belongs to. + 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. From 46f850930676d51bd2a71a8d40224435de045cbf Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Tue, 29 Oct 2024 14:56:13 +0100 Subject: [PATCH 5/7] fix: yaml max line length --- model/linux/registry.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/model/linux/registry.yaml b/model/linux/registry.yaml index d42f12ca76..1ad6f46cb0 100644 --- a/model/linux/registry.yaml +++ b/model/linux/registry.yaml @@ -27,4 +27,9 @@ groups: brief: The control group associated with the process. examples: ["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"] note: > - 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. + 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) + file. From cadd06f43d1726ade7144f8388e7f4ccfa4c3be2 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 21 Nov 2024 17:05:20 +0100 Subject: [PATCH 6/7] add reference to process resource registry --- docs/attributes-registry/linux.md | 2 +- docs/resource/process.md | 3 +++ model/process/resources.yaml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/attributes-registry/linux.md b/docs/attributes-registry/linux.md index 81045be452..0a1f196b00 100644 --- a/docs/attributes-registry/linux.md +++ b/docs/attributes-registry/linux.md @@ -32,4 +32,4 @@ Describes Linux Process attributes |---|---|---|---|---| | `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | -**[1]:** 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. +**[1] `linux.process.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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. diff --git a/docs/resource/process.md b/docs/resource/process.md index ba90335671..bef11c2f6e 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -42,6 +42,7 @@ | [`process.command_line`](/docs/attributes-registry/process.md) | string | The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.executable.path`](/docs/attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`linux.process.cgroup`](/docs/attributes-registry/linux.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) | | [`process.parent_pid`](/docs/attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -56,6 +57,8 @@ **[5] `process.executable.path`:** See [Selecting process attributes](#selecting-process-attributes) for details. +**[6] `linux.process.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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. + diff --git a/model/process/resources.yaml b/model/process/resources.yaml index 3c015d607e..75d3c8ae8a 100644 --- a/model/process/resources.yaml +++ b/model/process/resources.yaml @@ -23,6 +23,7 @@ groups: requirement_level: conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.owner + - ref: linux.process.cgroup - id: resource.process.runtime type: resource From 5e6eb3d1cc8d366ea8bb904f1fb56917bd6793f1 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Fri, 22 Nov 2024 15:41:19 +0100 Subject: [PATCH 7/7] fix: move process to the root namespace --- docs/attributes-registry/linux.md | 13 ------------- docs/attributes-registry/process.md | 11 +++++++++++ docs/resource/process.md | 4 ++-- model/linux/registry.yaml | 17 ----------------- model/process/registry.yaml | 17 +++++++++++++++++ model/process/resources.yaml | 2 +- 6 files changed, 31 insertions(+), 33 deletions(-) diff --git a/docs/attributes-registry/linux.md b/docs/attributes-registry/linux.md index 0a1f196b00..82c90fe1fb 100644 --- a/docs/attributes-registry/linux.md +++ b/docs/attributes-registry/linux.md @@ -6,9 +6,6 @@ # Linux -- [Linux Memory Attributes](#linux-memory-attributes) -- [Linux Process Attributes](#linux-process-attributes) - ## Linux Memory Attributes Describes Linux Memory attributes @@ -23,13 +20,3 @@ Describes Linux Memory attributes |---|---|---| | `reclaimable` | reclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `unreclaimable` | unreclaimable | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -## Linux Process Attributes - -Describes Linux Process attributes - -| Attribute | Type | Description | Examples | Stability | -|---|---|---|---|---| -| `linux.process.cgroup` | string | The control group associated with the process. [1] | `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) | - -**[1] `linux.process.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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index d03020506f..8684474edd 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -7,6 +7,7 @@ # Process - [Process Attributes](#process-attributes) +- [Process Linux Attributes](#process-linux-attributes) - [Deprecated Process Attributes](#deprecated-process-attributes) ## Process Attributes @@ -68,6 +69,16 @@ An operating system process. | `major` | major | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `minor` | minor | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +## Process Linux Attributes + +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) | + +**[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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. + ## Deprecated Process Attributes Deprecated process attributes. diff --git a/docs/resource/process.md b/docs/resource/process.md index bef11c2f6e..9f50e0e6b7 100644 --- a/docs/resource/process.md +++ b/docs/resource/process.md @@ -42,7 +42,7 @@ | [`process.command_line`](/docs/attributes-registry/process.md) | string | The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | `Conditionally Required` [3] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.executable.path`](/docs/attributes-registry/process.md) | string | The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. | `/usr/bin/cmd/otelcol` | `Conditionally Required` [5] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`linux.process.cgroup`](/docs/attributes-registry/linux.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.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) | | [`process.parent_pid`](/docs/attributes-registry/process.md) | int | Parent Process identifier (PPID). | `111` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`process.pid`](/docs/attributes-registry/process.md) | int | Process identifier (PID). | `1234` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -57,7 +57,7 @@ **[5] `process.executable.path`:** See [Selecting process attributes](#selecting-process-attributes) for details. -**[6] `linux.process.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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. +**[6] `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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file. diff --git a/model/linux/registry.yaml b/model/linux/registry.yaml index 1ad6f46cb0..a3bf3f1554 100644 --- a/model/linux/registry.yaml +++ b/model/linux/registry.yaml @@ -16,20 +16,3 @@ groups: stability: experimental brief: "The Linux Slab memory state" examples: ["reclaimable", "unreclaimable"] - # linux.process.* attribute group - - id: registry.linux.process - type: attribute_group - brief: "Describes Linux Process attributes" - attributes: - - id: linux.process.cgroup - type: string - stability: experimental - brief: The control group associated with the process. - examples: ["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"] - note: > - 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) - file. diff --git a/model/process/registry.yaml b/model/process/registry.yaml index d2df832b28..9cba5a78fe 100644 --- a/model/process/registry.yaml +++ b/model/process/registry.yaml @@ -241,3 +241,20 @@ groups: value: 'minor' stability: experimental stability: experimental + # process.linux* attribute group + - id: registry.process.linux + type: attribute_group + brief: "Describes Linux Process attributes" + attributes: + - id: process.linux.cgroup + type: string + stability: experimental + brief: The control group associated with the process. + examples: ["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"] + note: > + 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//cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) + file. diff --git a/model/process/resources.yaml b/model/process/resources.yaml index 75d3c8ae8a..3b3155439f 100644 --- a/model/process/resources.yaml +++ b/model/process/resources.yaml @@ -23,7 +23,7 @@ groups: requirement_level: conditionally_required: See [Selecting process attributes](#selecting-process-attributes) for details. - ref: process.owner - - ref: linux.process.cgroup + - ref: process.linux.cgroup - id: resource.process.runtime type: resource