# Process and process runtime resources

LLMS index: [llms.txt](/llms.txt)

---

**Status**: [Development][DocumentStatus]


## Process

<!-- semconv entity.process -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `process`

**Description:** An operating system process.

**Attributes:**

| Role | Key | Stability | [Requirement Level](/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`process.creation.time`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The date and time the process was created, in ISO 8601 format. | `2023-11-21T09:25:34.853Z` |
| Identity | [`process.pid`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Process identifier (PID). | `1234` |
| Description | [`process.args_count`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [1] | int | Length of the process.command_args array [2] | `4` |
| Description | [`process.command`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [3] | 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` |
| Description | [`process.command_args`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [4] | 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`. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data. | `["cmd/otecol", "--config=config.yaml"]` |
| Description | [`process.command_line`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [5] | 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. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data. | `C:\cmd\otecol --config="my directory\config.yaml"` |
| Description | [`process.executable.name`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [6] | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` |
| Description | [`process.executable.path`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` [7] | 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` |
| Description | [`process.interactive`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | boolean | Whether the process is connected to an interactive shell. | |
| Description | [`process.linux.cgroup`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The control group associated with the process. [8] | `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` |
| Description | [`process.owner`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The username of the user that owns the process. | `root` |
| Description | [`process.parent_pid`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | int | Parent Process identifier (PPID). | `111` |
| Description | [`process.title`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Process title (proctitle) [9] | `cat /etc/hostname`; `xfce4-session`; `bash` |
| Description | [`process.working_directory`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The working directory of the process. | `/root` |

**[1] `process.args_count`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[2] `process.args_count`:** This field can be useful for querying or performing bucket analysis on how many arguments were provided to start a process. More arguments may be an indication of suspicious activity.

**[3] `process.command`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[4] `process.command_args`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[5] `process.command_line`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[6] `process.executable.name`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[7] `process.executable.path`:** See [Selecting process attributes](/docs/specs/semconv/resource/process.md#selecting-process-attributes) for details.

**[8] `process.linux.cgroup`:** Control groups (cgroups) are a kernel feature used to organize and manage process resources. This attribute provides the path(s) to the cgroup(s) associated with the process, which should match the contents of the [/proc/\[PID\]/cgroup](https://man7.org/linux/man-pages/man7/cgroups.7.html) file.

**[9] `process.title`:** In many Unix-like systems, process title (proctitle), is the string that represents the name or command line of a running process, displayed by system monitoring tools like ps, top, and htop.
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Selecting process attributes

At least one of the following attributes is required:

* [`process.executable.name`](../registry/attributes/process.md)
* [`process.executable.path`](../registry/attributes/process.md)
* [`process.command`](../registry/attributes/process.md)
* [`process.command_line`](../registry/attributes/process.md)
* [`process.command_args`](../registry/attributes/process.md)

Between `process.command_args` and `process.command_line`, usually `process.command_args` should be preferred.
On Windows and other systems where the native format of process commands is a single string,
`process.command_line` can additionally (or instead) be used.

`process.args_count` can be additional be provided or instead when sanitization of the arguments is not being performed.

## Process runtimes

<!-- semconv entity.process.runtime -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `process.runtime`

**Description:** The single (language) runtime instance which is monitored.

**Attributes:**

| Role | Key | Stability | [Requirement Level](/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`process.runtime.name`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The name of the runtime of this process. | `OpenJDK Runtime Environment` |
| Identity | [`process.runtime.version`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | The version of the runtime of this process, as returned by the runtime without modification. | `14.0.2` |
| Description | [`process.runtime.description`](/docs/specs/semconv/registry/attributes/process.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | 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` |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

How to set these attributes for particular runtime kinds is described in the following subsections.

In addition to these attributes, [`telemetry.sdk.language`](README.md#telemetry-sdk) can be used to determine the general kind of runtime used.

### Erlang runtimes

- `process.runtime.name` - The name of the Erlang VM being used, i.e., `erlang:system_info(machine)`.
- `process.runtime.version` - The version of the runtime (ERTS - Erlang Runtime System), i.e., `erlang:system_info(version)`.
- `process.runtime.description` - string | An additional description about the runtime made by combining the OTP version, i.e., `erlang:system_info(otp_release)`, and ERTS version.

Example:

| `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- |
| BEAM | 11.1 | Erlang/OTP 23 erts-11.1 |

### Go runtimes

Go Runtimes SHOULD fill in the as follows:

- `process.runtime.name` - Fill in an interpretation of Go's [`runtime.Compiler`](https://pkg.go.dev/runtime#Compiler) constant, according to the following rule:
  If the value is `gc`, fill in `go`. Otherwise, fill in the exact value of `runtime.Compiler`.

  This can be implemented with the following Go snippet:

  ```go
  import "runtime"

  func getRuntimeName() string {
    if runtime.Compiler == "gc" {
      return "go"
    }
    return runtime.Compiler
  }
  ```

- `process.runtime.version` - Fill in the exact value returned by `runtime.Version()`, i.e. `go1.17`.
- `process.runtime.description` - Use of this field is not recommended.

Examples for some Go compilers/runtimes:

| `process.runtime.name` | Description |
| --- | --- |
| `go` | Official Go compiler. Also known as `cmd/compile`. |
| `gccgo` | [gccgo](https://go.dev/doc/install/gccgo) is a Go [front end for GCC](https://gcc.gnu.org/frontends.html). |
| `tinygo` | [TinyGo](https://tinygo.org/) compiler. |

### Java runtimes

Java instrumentation SHOULD fill in the values by copying from system properties.

- `process.runtime.name` - Fill in the value of `java.runtime.name` as is
- `process.runtime.version` - Fill in the value of `java.runtime.version` as is
- `process.runtime.description` - Fill in the values of `java.vm.vendor`, `java.vm.name`, `java.vm.version`
  in that order, separated by spaces.

Examples for some Java runtimes

| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- | --- |
| OpenJDK | OpenJDK Runtime Environment | 11.0.8+10 | Oracle Corporation OpenJDK 64-Bit Server VM 11.0.8+10 |
| AdoptOpenJDK Eclipse J9 | OpenJDK Runtime Environment | 11.0.8+10 | Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0 |
| AdoptOpenJDK Hotspot | OpenJDK Runtime Environment | 11.0.8+10 | AdoptOpenJDK OpenJDK 64-Bit Server VM 11.0.8+10 |
| SapMachine | OpenJDK Runtime Environment | 11.0.8+10-LTS-sapmachine | SAP SE OpenJDK 64-Bit Server VM 11.0.8+10-LTS-sapmachine |
| Zulu OpenJDK | OpenJDK Runtime Environment | 11.0.8+10-LTS | Azul Systems, Inc OpenJDK 64-Bit Server VM Zulu11.41+23-CA |
| Oracle Hotspot 8 (32 bit) | Java(TM) SE Runtime Environment | 1.8.0_221-b11 | Oracle Corporation Java HotSpot(TM) Client VM 25.221-b11 |
| IBM J9 8 | Java(TM) SE Runtime Environment | 8.0.5.25 - pwa6480sr5fp25-20181030_01(SR5 FP25) | IBM Corporation IBM J9 VM 2.9 |
| Android 11 | Android Runtime | 0.9 | The Android Project Dalvik 2.1.0 |

### JavaScript runtimes

JavaScript instrumentation SHOULD fill in the values by copying from built-in runtime constants.

- `process.runtime.name`:
  - When the runtime is Node.js, fill in the constant value `nodejs`.
  - When the runtime is Web Browser, fill in the constant value `browser`.
- `process.runtime.version`:
  - When the runtime is Node.js, fill in the value of `process.versions.node`.
  - When the runtime is Web Browser, fill in the value of `navigator.userAgent`.

Examples for some JavaScript runtimes

| Name | `process.runtime.name` | `process.runtime.version` |
| --- | --- | --- |
| Node.js | nodejs | 14.15.4 |
| Web Browser | browser | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 |

### .NET runtimes

.NET instrumentation SHOULD fill in the values by following values:

- `process.runtime.name` - Fill in the value by the name of runtime.
- `process.runtime.version` - Fill in the value of `System.Environment.Version` for .NET,
  determine version based on the [registry values](https://learn.microsoft.com/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#query-the-registry-using-code)
  for .NET Framework
- `process.runtime.description` - Fill in the values of `System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription`.

`process.runtime.name` has the following list of well-known values. If one of them applies, then the respective value SHOULD be used, otherwise a custom value SHOULD be used.

- .NET Framework
- .NET
- .NET Core
- .NET Native

Examples for some .NET runtimes

| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- | --- |
| .NET Framework | .NET Framework | 4.8 | .NET Framework 4.8.9195.0 |
| .NET | .NET | 7.0.14 | .NET 7.0.14 |

### Python runtimes

Python instrumentation SHOULD fill in the values as follows:

- `process.runtime.name` -
  Fill in the value of [`sys.implementation.name`][py_impl]
- `process.runtime.version` -
  Fill in the [`sys.implementation.version`][py_impl] values separated by dots.
  Leave out the release level and serial if the release level
  equals `final` and the serial equals zero
  (leave out either both or none).

  This can be implemented with the following Python snippet:

  ```python
  vinfo = sys.implementation.version
  result =  ".".join(map(
      str,
      vinfo[:3]
      if vinfo.releaselevel == "final" and not vinfo.serial
      else vinfo
  ))
  ```

- `process.runtime.description` - Fill in the value of [`sys.version`](https://docs.python.org/3/library/sys.html#sys.version) as-is.

[py_impl]: https://docs.python.org/3/library/sys.html#sys.implementation

Examples for some Python runtimes:

| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- | --- |
| CPython 3.7.3 on Windows | cpython | 3.7.3 | 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] |
| CPython 3.13.1 on Linux | cpython | 3.13.1 | 3.13.1 (main, Dec  6 2024, 18:40:43) [Clang 18.1.8 ] |
| PyPy 3 7.3.17 on Linux | pypy | 7.3.17 | 3.10.14 (39dc8d3c85a7, Aug 27 2024, 14:32:27)<br>[PyPy 7.3.17 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] |

Note that on CPython GCC/Clang Linux builds (up to and including 3.9) and PyPy, there is an actual newline in the `sys.version` string.

### Ruby runtimes

Ruby instrumentation SHOULD fill in the values by copying from built-in runtime constants.

- `process.runtime.name` - Fill in the value of `RUBY_ENGINE` as is
- `process.runtime.version` - Fill in the value of `RUBY_VERSION` as is
- `process.runtime.description` - Fill in the value of `RUBY_DESCRIPTION` as is

Examples for some Ruby runtimes

| Name | `process.runtime.name` | `process.runtime.version` | `process.runtime.description` |
| --- | --- | --- | --- |
| MRI | ruby | 2.7.1 | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19] |
| TruffleRuby | truffleruby | 2.6.2 | truffleruby (Shopify) 20.0.0-dev-92ed3059, like ruby 2.6.2, GraalVM CE Native [x86_64-darwin] |

[DocumentStatus]: /docs/specs/otel/document-status
