367 lines
18 KiB
Markdown
367 lines
18 KiB
Markdown
<!--- Hugo front matter used to generate the website version of this page:
|
|
linkTitle: OS process
|
|
--->
|
|
|
|
# Semantic conventions for OS process metrics
|
|
|
|
**Status**: [Development][DocumentStatus]
|
|
|
|
This document describes instruments and attributes for common OS process level
|
|
metrics in OpenTelemetry. Also consider the [general metric semantic
|
|
conventions](/docs/general/metrics.md#general-guidelines) when creating
|
|
instruments not explicitly defined in this document. OS process metrics are
|
|
not related to the runtime environment of the program, and should take
|
|
measurements from the operating system. For runtime environment metrics see
|
|
[semantic conventions for runtime environment
|
|
metrics](/docs/runtime/README.md#metrics).
|
|
|
|
<!-- toc -->
|
|
|
|
- [Process metrics](#process-metrics)
|
|
- [Metric: `process.cpu.time`](#metric-processcputime)
|
|
- [Metric: `process.cpu.utilization`](#metric-processcpuutilization)
|
|
- [Metric: `process.memory.usage`](#metric-processmemoryusage)
|
|
- [Metric: `process.memory.virtual`](#metric-processmemoryvirtual)
|
|
- [Metric: `process.disk.io`](#metric-processdiskio)
|
|
- [Metric: `process.network.io`](#metric-processnetworkio)
|
|
- [Metric: `process.thread.count`](#metric-processthreadcount)
|
|
- [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 -->
|
|
|
|
> **Warning** Existing instrumentations and collector that are using
|
|
> [v1.21.0 of this document](https://github.com/open-telemetry/semantic-conventions/blob/v1.21.0/docs/system/process-metrics.md)
|
|
> (or prior):
|
|
>
|
|
> * SHOULD NOT adopt any breaking changes from document until the system
|
|
> semantic conventions are marked stable. Conventions include, but are not
|
|
> limited to, attributes, metric names, and unit of measure.
|
|
> * SHOULD introduce a control mechanism to allow users to opt-in to the new
|
|
> conventions once the migration plan is finalized.
|
|
|
|
## Process metrics
|
|
|
|
### Metric: `process.cpu.time`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.cpu.time -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.cpu.time` | Counter | `s` | Total CPU seconds broken down by different states. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Recommended` |  |
|
|
|
|
**[1] `cpu.mode`:** Following states SHOULD be used: `user`, `system`, `wait`
|
|
|
|
---
|
|
|
|
`cpu.mode` 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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `idle` | Idle |  |
|
|
| `interrupt` | Interrupt |  |
|
|
| `iowait` | IO Wait |  |
|
|
| `kernel` | Kernel |  |
|
|
| `nice` | Nice |  |
|
|
| `steal` | Steal |  |
|
|
| `system` | System |  |
|
|
| `user` | User |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.cpu.utilization`
|
|
|
|
This metric is [opt-in][MetricOptIn].
|
|
|
|
<!-- semconv metric.process.cpu.utilization -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.cpu.utilization` | Gauge | `1` | Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`cpu.mode`](/docs/registry/attributes/cpu.md) | string | A process SHOULD be characterized _either_ by data points with no `mode` labels, _or only_ data points with `mode` labels. [1] | `user`; `system` | `Recommended` |  |
|
|
|
|
**[1] `cpu.mode`:** Following states SHOULD be used: `user`, `system`, `wait`
|
|
|
|
---
|
|
|
|
`cpu.mode` 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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `idle` | Idle |  |
|
|
| `interrupt` | Interrupt |  |
|
|
| `iowait` | IO Wait |  |
|
|
| `kernel` | Kernel |  |
|
|
| `nice` | Nice |  |
|
|
| `steal` | Steal |  |
|
|
| `system` | System |  |
|
|
| `user` | User |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.memory.usage`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.memory.usage -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.memory.usage` | UpDownCounter | `By` | The amount of physical memory in use. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.memory.virtual`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.memory.virtual -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.memory.virtual` | UpDownCounter | `By` | The amount of committed virtual memory. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.disk.io`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.disk.io -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.disk.io` | Counter | `By` | Disk bytes transferred. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`disk.io.direction`](/docs/registry/attributes/disk.md) | string | The disk IO operation direction. | `read` | `Recommended` |  |
|
|
|
|
---
|
|
|
|
`disk.io.direction` 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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `read` | read |  |
|
|
| `write` | write |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.network.io`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.network.io -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.network.io` | Counter | `By` | Network bytes transferred. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`network.io.direction`](/docs/registry/attributes/network.md) | string | The network IO operation direction. | `transmit` | `Recommended` |  |
|
|
|
|
---
|
|
|
|
`network.io.direction` 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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `receive` | receive |  |
|
|
| `transmit` | transmit |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.thread.count`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.thread.count -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.thread.count` | UpDownCounter | `{thread}` | Process threads count. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.open_file_descriptor.count`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.open_file_descriptor.count -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.open_file_descriptor.count` | UpDownCounter | `{file_descriptor}` | Number of file descriptors in use by the process. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.context_switches`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.context_switches -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.context_switches` | Counter | `{context_switch}` | Number of times the process has been context switched. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`process.context_switch_type`](/docs/registry/attributes/process.md) | string | Specifies whether the context switches for this data point were voluntary or involuntary. | `voluntary`; `involuntary` | `Recommended` |  |
|
|
|
|
---
|
|
|
|
`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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `involuntary` | involuntary |  |
|
|
| `voluntary` | voluntary |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.paging.faults`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.paging.faults -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.paging.faults` | Counter | `{fault}` | Number of page faults the process has made. |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`process.paging.fault_type`](/docs/registry/attributes/process.md) | string | The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. | `major`; `minor` | `Recommended` |  |
|
|
|
|
---
|
|
|
|
`process.paging.fault_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.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `major` | major |  |
|
|
| `minor` | minor |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### Metric: `process.uptime`
|
|
|
|
This metric is [recommended][MetricRecommended].
|
|
|
|
<!-- semconv metric.process.uptime -->
|
|
<!-- 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 | Entity Associations |
|
|
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
|
|
| `process.uptime` | Gauge | `s` | The time the process has been running. [1] |  | [`process`](/docs/registry/entities/process.md#process) |
|
|
|
|
**[1]:** Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available.
|
|
The actual accuracy would depend on the instrumentation and operating system.
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
|
|
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
|
|
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in
|