Skip to content

Commit

Permalink
Add process.uptime and system.uptime metrics to semantic conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej-stencel committed Sep 23, 2022
1 parent 0ff1c36 commit 60189f8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ release.
- Add `process.context_switches`, and `process.open_file_descriptors`, to the
metrics semantic conventions
([#2706](https://github.com/open-telemetry/opentelemetry-specification/pull/2706))
- Add `process.uptime` and `system.uptime` metrics to semantic conventions

### Compatibility

Expand Down
23 changes: 12 additions & 11 deletions specification/metrics/semantic_conventions/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ metrics](runtime-environment-metrics.md).

Below is a table of Process metric instruments.

| Name | Instrument Type ([\*](README.md#instrument-types)) | Unit | Description | Labels |
| -------------------------------------- | -------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `process.cpu.time` | Counter | s | Total CPU seconds broken down by different states. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `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. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.memory.usage` | UpDownCounter | By | The amount of physical memory in use. | |
| `process.memory.virtual` | UpDownCounter | By | The amount of committed virtual memory. | |
| `process.disk.io` | Counter | By | Disk bytes transferred. | `direction` SHOULD be one of: `read`, `write` |
| `process.network.io` | Counter | By | Network bytes transferred. | `direction` SHOULD be one of: `receive`, `transmit` |
| `process.threads` | UpDownCounter | {threads} | Process threads count. | |
| `process.open_file_descriptors` | UpDownCounter | {count} | Number of file descriptors in use by the process. | |
| `process.context_switches` | Counter | {count} | Number of times the process has been context switched. | `type` SHOULD be one of: `involuntary`, `voluntary` |
| Name | Instrument Type ([\*](README.md#instrument-types)) | Unit | Description | Labels |
| ------------------------------- | -------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `process.cpu.time` | Counter | s | Total CPU seconds broken down by different states. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `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. | `state`, if specified, SHOULD be one of: `system`, `user`, `wait`. A process SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. |
| `process.memory.usage` | UpDownCounter | By | The amount of physical memory in use. | |
| `process.memory.virtual` | UpDownCounter | By | The amount of committed virtual memory. | |
| `process.disk.io` | Counter | By | Disk bytes transferred. | `direction` SHOULD be one of: `read`, `write` |
| `process.network.io` | Counter | By | Network bytes transferred. | `direction` SHOULD be one of: `receive`, `transmit` |
| `process.threads` | UpDownCounter | {threads} | Process threads count. | |
| `process.open_file_descriptors` | UpDownCounter | {count} | Number of file descriptors in use by the process. | |
| `process.context_switches` | Counter | {count} | Number of times the process has been context switched. | `type` SHOULD be one of: `involuntary`, `voluntary` |
| `process.uptime` | Counter | s | Number of seconds that the process has been running. | |

## Attributes

Expand Down
9 changes: 9 additions & 0 deletions specification/metrics/semantic_conventions/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ instruments not explicitly defined in the specification.
<!-- toc -->

- [Metric Instruments](#metric-instruments)
* [`system.` - General system metrics](#system---general-system-metrics)
* [`system.cpu.` - Processor metrics](#systemcpu---processor-metrics)
* [`system.memory.` - Memory metrics](#systemmemory---memory-metrics)
* [`system.paging.` - Paging/swap metrics](#systempaging---pagingswap-metrics)
Expand All @@ -29,6 +30,14 @@ instruments not explicitly defined in the specification.

## Metric Instruments

### `system.` - General system metrics

**Description:** General system metrics.

| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values |
| ---------------------- | -------------------------------------------------------------------------------------------------------- | ----- | ------------------------------------------------- | ---------- | ---------------- | ----------------------------------- |
| system.uptime | Number of seconds that the system has been running. | s | Counter | Int64 | | |

### `system.cpu.` - Processor metrics

**Description:** System level processor metrics.
Expand Down

0 comments on commit 60189f8

Please sign in to comment.