Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional process fields from ECS #993

Merged
merged 28 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7976ec6
Add additional process field from ECS
mjwolf May 1, 2024
87ed02f
Update changelog
mjwolf May 1, 2024
09dfec5
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf May 1, 2024
8159bb3
Rework proctitle description
mjwolf May 2, 2024
14e4761
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf May 9, 2024
4bdb4f1
Change process.uptime into metric
mjwolf May 9, 2024
b962c40
Merge branch 'main' into process-fields
trisch-me May 13, 2024
5ddf492
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf May 17, 2024
8c1aab5
Add `process.args_count` as a metric
mjwolf May 17, 2024
e5556de
Merge branch 'process-fields' of github.com:mjwolf/semantic-conventio…
mjwolf May 17, 2024
f58a91b
Merge branch 'main' into process-fields
trisch-me May 21, 2024
f5203fe
Merge branch 'main' into process-fields
trisch-me Jun 6, 2024
e8b6197
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf Jun 7, 2024
9d54451
Remove args_count from process metrics
mjwolf Jun 7, 2024
2170297
Merge branch 'process-fields' of github.com:mjwolf/semantic-conventio…
mjwolf Jun 7, 2024
fc120fe
Merge branch 'main' into process-fields
mjwolf Jun 24, 2024
c1faf95
Merge branch 'main' into process-fields
trisch-me Jul 17, 2024
b6b1ba8
Update proctitle and uptime descriptions
mjwolf Jul 18, 2024
cf0af2f
Update doc
mjwolf Jul 18, 2024
49c1c11
Add process.uptime to metrics docs
mjwolf Jul 18, 2024
3626e9f
Fix linting issue
mjwolf Jul 18, 2024
74eb5bf
Merge branch 'main' into process-fields
mjwolf Jul 18, 2024
becba6e
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf Jul 22, 2024
927619e
Merge branch 'process-fields' of github.com:mjwolf/semantic-conventio…
mjwolf Jul 22, 2024
0448dfb
Set recommended level for process.args_count
mjwolf Jul 22, 2024
6bb30d7
Merge remote-tracking branch 'upstream/main' into process-fields
mjwolf Aug 1, 2024
614d7de
Add note to process.uptime metric re: precision
mjwolf Aug 1, 2024
c78cdd4
Merge branch 'main' into process-fields
lmolkova Aug 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .chloggen/993.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: process
note: Add additional process fields from ECS
issues: [993]
11 changes: 9 additions & 2 deletions docs/attributes-registry/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ An operating system process.

| Attribute | Type | Description | Examples | Stability |
| ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------- |
| `args_count` | int | Length of the process.command_args array [1] | `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `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) |
Expand All @@ -40,9 +41,15 @@ An operating system process.
| `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.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) |
| `process.vpid` | int | Virtual process identifier. [2] | `12` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `title` | string | Process title (proctitle) [3] | `cat /etc/hostname`; `xfce4-session`; `bash` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `working_directory` | string | The working directory of the process. | `/root` | ![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.
**[1]:** This field can be useful for querying or performing bucket analysis on how many arguments were provided to start a process. More arguments may be an indication of suspicious activity.

**[2]:** The process ID within a PID namespace. This is not necessarily unique across all processes on the host but it is unique within the process namespace that the process exists within.

**[3]:** In many Unix-like systems, process title (proctitle), is the string that represents the name or command line of a running process, displayed by system monitoring tools like ps, top, and htop.

`process.context_switch_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Expand Down
39 changes: 39 additions & 0 deletions docs/system/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ metrics](/docs/runtime/README.md#metrics).
- [Metric: `process.open_file_descriptor.count`](#metric-processopen_file_descriptorcount)
- [Metric: `process.context_switches`](#metric-processcontext_switches)
- [Metric: `process.paging.faults`](#metric-processpagingfaults)
- [Metric: `process.uptime`](#metric-processuptime)

<!-- tocstop -->

Expand Down Expand Up @@ -472,6 +473,44 @@ This metric is [recommended][MetricRecommended].



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `process.uptime`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.process.uptime(metric_table) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `process.uptime` | Counter | `s` | The time the process has been running. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


**[1]:** Instrumentations SHOULD use counter with type `double` and measure uptime with at least millisecond precision



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

<!-- semconv metric.process.uptime(full) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
10 changes: 10 additions & 0 deletions model/metrics/process-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ groups:
unit: "{count}"
attributes:
- ref: process.context_switch_type

- id: metric.process.paging.faults
type: metric
metric_name: process.paging.faults
Expand All @@ -101,3 +102,12 @@ groups:
unit: "{fault}"
attributes:
- ref: process.paging.fault_type

- id: metric.process.uptime
mjwolf marked this conversation as resolved.
Show resolved Hide resolved
mjwolf marked this conversation as resolved.
Show resolved Hide resolved
type: metric
metric_name: process.uptime
stability: experimental
brief: "The time the process has been running."
instrument: counter
unit: "s"
note: "Instrumentations SHOULD use counter with type `double` and measure uptime with at least millisecond precision"
28 changes: 28 additions & 0 deletions model/registry/process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ 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: args_count
type: int
stability: experimental
brief: >
Length of the process.command_args array
note: >
This field can be useful for querying or performing bucket analysis on how many
arguments were provided to start a process. More arguments may be an indication
of suspicious activity.
requirement_level:
recommended: if `process.command_args` is populated.
examples: [4]
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
- id: process.owner
type: string
stability: experimental
Expand Down Expand Up @@ -146,6 +158,16 @@ 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: title
type: string
stability: experimental
brief: >
Process title (proctitle)
note: >
In many Unix-like systems, process title (proctitle), is the string
that represents the name or command line of a running process,
displayed by system monitoring tools like ps, top, and htop.
examples: ["cat /etc/hostname", "xfce4-session", "bash"]
- id: process.creation.time
type: string
stability: experimental
Expand All @@ -169,6 +191,12 @@ groups:
stability: experimental
brief: >
Whether the process is connected to an interactive shell.
- id: working_directory
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
type: string
stability: experimental
brief: >
The working directory of the process.
examples: ["/root"]
- id: process.context_switch_type
brief: "Specifies whether the context switches for this data point were voluntary or involuntary."
type:
Expand Down
Loading