|
| 1 | +<!--- Hugo front matter used to generate the website version of this page: |
| 2 | +linkTitle: Container |
| 3 | +---> |
| 4 | + |
| 5 | +# Semantic Conventions for Container Metrics |
| 6 | + |
| 7 | +**Status**: [Experimental][DocumentStatus] |
| 8 | + |
| 9 | +## Container Metrics |
| 10 | + |
| 11 | +### Metric: `container.cpu.time` |
| 12 | + |
| 13 | +This metric is [opt-in][MetricOptIn]. |
| 14 | + |
| 15 | +<!-- semconv metric.container.cpu.time(metric_table) --> |
| 16 | +| Name | Instrument Type | Unit (UCUM) | Description | |
| 17 | +| -------- | --------------- | ----------- | -------------- | |
| 18 | +| `container.cpu.time` | Counter | `s` | Total CPU time consumed [1] | |
| 19 | + |
| 20 | +**[1]:** Total CPU time consumed by the specific container on all available CPU cores |
| 21 | +<!-- endsemconv --> |
| 22 | + |
| 23 | +<!-- semconv metric.container.cpu.time(full) --> |
| 24 | +| Attribute | Type | Description | Examples | Requirement Level | |
| 25 | +|---|---|---|---|---| |
| 26 | +| [`container.cpu.state`](../attributes-registry/container.md) | string | The CPU state for this data point. A container SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `user`; `kernel` | Opt-In | |
| 27 | + |
| 28 | +`container.cpu.state` 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. |
| 29 | + |
| 30 | +| Value | Description | |
| 31 | +|---|---| |
| 32 | +| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | |
| 33 | +| `system` | When CPU is used by the system (host OS) | |
| 34 | +| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | |
| 35 | +<!-- endsemconv --> |
| 36 | + |
| 37 | +### Metric: `container.memory.usage` |
| 38 | + |
| 39 | +This metric is [opt-in][MetricOptIn]. |
| 40 | + |
| 41 | +<!-- semconv metric.container.memory.usage(metric_table) --> |
| 42 | +| Name | Instrument Type | Unit (UCUM) | Description | |
| 43 | +| -------- | --------------- | ----------- | -------------- | |
| 44 | +| `container.memory.usage` | Counter | `By` | Memory usage of the container. [1] | |
| 45 | + |
| 46 | +**[1]:** Memory usage of the container. |
| 47 | +<!-- endsemconv --> |
| 48 | + |
| 49 | +<!-- semconv metric.container.memory.usage(full) --> |
| 50 | +<!-- endsemconv --> |
| 51 | + |
| 52 | +### Metric: `container.disk.io` |
| 53 | + |
| 54 | +This metric is [opt-in][MetricOptIn]. |
| 55 | + |
| 56 | +<!-- semconv metric.container.disk.io(metric_table) --> |
| 57 | +| Name | Instrument Type | Unit (UCUM) | Description | |
| 58 | +| -------- | --------------- | ----------- | -------------- | |
| 59 | +| `container.disk.io` | Counter | `By` | Disk bytes for the container. [1] | |
| 60 | + |
| 61 | +**[1]:** The total number of bytes read/written successfully (aggregated from all disks). |
| 62 | +<!-- endsemconv --> |
| 63 | + |
| 64 | +<!-- semconv metric.container.disk.io(full) --> |
| 65 | +| Attribute | Type | Description | Examples | Requirement Level | |
| 66 | +|---|---|---|---|---| |
| 67 | +| [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended | |
| 68 | +| `system.device` | string | The device identifier | `(identifier)` | Recommended | |
| 69 | + |
| 70 | +`disk.io.direction` MUST be one of the following: |
| 71 | + |
| 72 | +| Value | Description | |
| 73 | +|---|---| |
| 74 | +| `read` | read | |
| 75 | +| `write` | write | |
| 76 | +<!-- endsemconv --> |
| 77 | + |
| 78 | +### Metric: `container.network.io` |
| 79 | + |
| 80 | +This metric is [opt-in][MetricOptIn]. |
| 81 | + |
| 82 | +<!-- semconv metric.container.network.io(metric_table) --> |
| 83 | +| Name | Instrument Type | Unit (UCUM) | Description | |
| 84 | +| -------- | --------------- | ----------- | -------------- | |
| 85 | +| `container.network.io` | Counter | `By` | Network bytes for the container. [1] | |
| 86 | + |
| 87 | +**[1]:** The number of bytes sent/received on all network interfaces by the container. |
| 88 | +<!-- endsemconv --> |
| 89 | + |
| 90 | +<!-- semconv metric.container.network.io(full) --> |
| 91 | +| Attribute | Type | Description | Examples | Requirement Level | |
| 92 | +|---|---|---|---|---| |
| 93 | +| [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended | |
| 94 | +| `system.device` | string | The device identifier | `(identifier)` | Recommended | |
| 95 | + |
| 96 | +`network.io.direction` MUST be one of the following: |
| 97 | + |
| 98 | +| Value | Description | |
| 99 | +|---|---| |
| 100 | +| `transmit` | transmit | |
| 101 | +| `receive` | receive | |
| 102 | +<!-- endsemconv --> |
| 103 | + |
| 104 | +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md |
| 105 | +[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in |
0 commit comments