From f87c8647557ba407eaf5e9ea8c6f2e3cfdf39094 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 24 Aug 2023 12:09:11 +0300 Subject: [PATCH 01/14] Add container metric fields Signed-off-by: ChrsMark --- CHANGELOG.md | 2 + docs/system/container-metrics.md | 101 +++++++++++++++++++++++++++++++ model/metrics/container.yaml | 57 +++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 docs/system/container-metrics.md create mode 100644 model/metrics/container.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7537d61028..d2d0a55865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -364,6 +364,8 @@ stabilized. - Make `network.protocol.name|version` description consistent between HTTP spans and metrics. ([#367](https://github.com/open-telemetry/semantic-conventions/pull/367)) +- Add container metric fields (from ECS). + ([#282](https://github.com/open-telemetry/semantic-conventions/pull/282)) ## v1.21.0 (2023-07-13) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md new file mode 100644 index 0000000000..48947005dd --- /dev/null +++ b/docs/system/container-metrics.md @@ -0,0 +1,101 @@ + + +# Semantic Conventions for Container Metrics + +**Status**: [Experimental][DocumentStatus] + +## Container Metrics + +### Metric: `container.cpu.usage` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.cpu.usage` | Gauge | `1` | Recent CPU utilization for the container. [1] | + +**[1]:** CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0]. + + + + + +### Metric: `container.memory.usage` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.memory.usage` | Gauge | `1` | Recent memory utilization for the container. [1] | + +**[1]:** Memory usage percentage. The value range is [0.0,1.0]. + + + + + +### Metric: `container.disk.read.bytes` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.disk.read.bytes` | Counter | `By` | Disk read bytes for the container. [1] | + +**[1]:** The total number of bytes read successfully (aggregated from all disks). + + + + + +### Metric: `container.disk.write.bytes` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.disk.write.bytes` | Counter | `By` | Disk write bytes for the container. [1] | + +**[1]:** The total number of bytes written successfully (aggregated from all disks). + + + + + +### Metric: `container.network.ingress.bytes` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.network.ingress.bytes` | Counter | `By` | Network ingress bytes for the container. [1] | + +**[1]:** The number of bytes received on all network interfaces by the container. + + + + + +### Metric: `container.network.egress.bytes` + +This metric is optional. + + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `container.network.egress.bytes` | Counter | `By` | Network egress bytes for the container. [1] | + +**[1]:** The number of bytes sent out on all network interfaces by the container. + + + + + +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml new file mode 100644 index 0000000000..6ecf2b40e9 --- /dev/null +++ b/model/metrics/container.yaml @@ -0,0 +1,57 @@ +groups: + - id: metric.container.cpu.usage + type: metric + metric_name: container.cpu.usage + brief: "Recent CPU utilization for the container." + note: > + CPU usage percentage normalized by the number of CPU cores. + The value range is [0.0,1.0]. + instrument: gauge + unit: "1" + - id: metric.container.memory.usage + type: metric + metric_name: container.memory.usage + brief: "Recent memory utilization for the container." + note: > + Memory usage percentage. + The value range is [0.0,1.0]. + instrument: gauge + unit: "1" + - id: metric.container.disk.read.bytes + type: metric + metric_name: container.disk.read.bytes + brief: "Disk read bytes for the container." + note: > + The total number of bytes read + successfully (aggregated from all disks). + instrument: counter + unit: "By" + - id: metric.container.disk.write.bytes + type: metric + metric_name: container.disk.write.bytes + brief: "Disk write bytes for the container." + note: > + The total number of bytes written + successfully (aggregated from all disks). + instrument: counter + unit: "By" + - id: metric.container.network.ingress.bytes + type: metric + metric_name: container.network.ingress.bytes + brief: "Network ingress bytes for the container." + note: > + The number of bytes received + on all network interfaces + by the container. + instrument: counter + unit: "By" + - id: metric.container.network.egress.bytes + type: metric + metric_name: container.network.egress.bytes + brief: "Network egress bytes for the container." + note: > + The number of bytes sent out + on all network interfaces + by the container. + instrument: counter + unit: "By" From bd12130bf5a2193e8c80013097f8839de67b67b3 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 13 Oct 2023 10:27:54 +0100 Subject: [PATCH 02/14] Update naming and add attributes Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 86 +++++++++++++++---------------- model/metrics/container.yaml | 87 ++++++++++++++++++++------------ 2 files changed, 98 insertions(+), 75 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 48947005dd..1b7ef329be 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -8,94 +8,92 @@ linkTitle: Container ## Container Metrics -### Metric: `container.cpu.usage` +### Metric: `container.cpu.utilization` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.cpu.usage` | Gauge | `1` | Recent CPU utilization for the container. [1] | +| `container.cpu.utilization` | Gauge | `1` | Recent CPU utilization for the container. [1] | **[1]:** CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0]. - + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -### Metric: `container.memory.usage` +### Metric: `container.memory.utilization` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.memory.usage` | Gauge | `1` | Recent memory utilization for the container. [1] | +| `container.memory.utilization` | Gauge | `1` | Recent memory utilization for the container. [1] | **[1]:** Memory usage percentage. The value range is [0.0,1.0]. - + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -### Metric: `container.disk.read.bytes` +### Metric: `container.disk.io.bytes` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.disk.read.bytes` | Counter | `By` | Disk read bytes for the container. [1] | +| `container.disk.io.bytes` | Counter | `By` | Disk bytes for the container. [1] | -**[1]:** The total number of bytes read successfully (aggregated from all disks). +**[1]:** The total number of bytes read/written successfully (aggregated from all disks). - - - -### Metric: `container.disk.write.bytes` - -This metric is optional. + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `container.disk.io.direction` | string | The disk IO operation's direction | `read`; `write` | Recommended | +| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| `container.disk.write.bytes` | Counter | `By` | Disk write bytes for the container. [1] | - -**[1]:** The total number of bytes written successfully (aggregated from all disks). - +`container.disk.io.direction` MUST be one of the following: - +| Value | Description | +|---|---| +| `read` | read | +| `write` | write | -### Metric: `container.network.ingress.bytes` +### Metric: `container.network.io.bytes` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.network.ingress.bytes` | Counter | `By` | Network ingress bytes for the container. [1] | +| `container.disk.io.bytes` | Counter | `By` | Network bytes for the container. [1] | -**[1]:** The number of bytes received on all network interfaces by the container. +**[1]:** The number of bytes sent/received on all network interfaces by the container. - - - -### Metric: `container.network.egress.bytes` - -This metric is optional. + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| `container.network.io.direction` | string | The Network IO direction | `ingress`; `egress` | Recommended | - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| `container.network.egress.bytes` | Counter | `By` | Network egress bytes for the container. [1] | - -**[1]:** The number of bytes sent out on all network interfaces by the container. - +`container.network.io.direction` MUST be one of the following: - +| Value | Description | +|---|---| +| `ingress` | ingress | +| `egress` | egress | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index 6ecf2b40e9..b5de053616 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -1,57 +1,82 @@ groups: - - id: metric.container.cpu.usage + - id: metric.container.cpu.utilization type: metric - metric_name: container.cpu.usage + metric_name: container.cpu.utilization brief: "Recent CPU utilization for the container." note: > CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0]. instrument: gauge unit: "1" - - id: metric.container.memory.usage + attributes: + - ref: container.id + - id: metric.container.memory.utilization type: metric - metric_name: container.memory.usage + metric_name: container.memory.utilization brief: "Recent memory utilization for the container." note: > Memory usage percentage. The value range is [0.0,1.0]. instrument: gauge unit: "1" - - id: metric.container.disk.read.bytes + attributes: + - ref: container.id + + # container.disk.io.* metrics and attribute group + - id: attributes.container.disk.io + prefix: container.disk.io + type: attribute_group + brief: "Describes Container Disk IO metric attributes" + attributes: + - id: direction + type: + allow_custom_values: false + members: + - id: read + value: 'read' + - id: write + value: 'write' + brief: "The disk IO operation's direction" + examples: [ "read", "write" ] + - id: metric.container.disk.io.bytes type: metric - metric_name: container.disk.read.bytes - brief: "Disk read bytes for the container." + metric_name: container.disk.io.bytes + brief: "Disk bytes for the container." note: > - The total number of bytes read + The total number of bytes read/written successfully (aggregated from all disks). instrument: counter unit: "By" - - id: metric.container.disk.write.bytes + attributes: + - ref: container.id + - ref: container.disk.io.direction + + # container.network.io.* metrics and attribute group + - id: attributes.container.network.io + prefix: container.network.io + type: attribute_group + brief: "Describes Container Network IO metric attributes" + attributes: + - id: direction + type: + allow_custom_values: false + members: + - id: ingress + value: 'ingress' + - id: egress + value: 'egress' + brief: "The Network IO direction" + examples: [ "ingress", "egress" ] + - id: metric.container.network.io.bytes type: metric - metric_name: container.disk.write.bytes - brief: "Disk write bytes for the container." + metric_name: container.disk.io.bytes + brief: "Network bytes for the container." note: > - The total number of bytes written - successfully (aggregated from all disks). - instrument: counter - unit: "By" - - id: metric.container.network.ingress.bytes - type: metric - metric_name: container.network.ingress.bytes - brief: "Network ingress bytes for the container." - note: > - The number of bytes received - on all network interfaces - by the container. - instrument: counter - unit: "By" - - id: metric.container.network.egress.bytes - type: metric - metric_name: container.network.egress.bytes - brief: "Network egress bytes for the container." - note: > - The number of bytes sent out + The number of bytes sent/received on all network interfaces by the container. instrument: counter unit: "By" + attributes: + - ref: container.id + - ref: container.network.io.direction From e901bb00c538f63fe25797e6f430e407ec0c2203 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 23 Nov 2023 10:35:24 +0000 Subject: [PATCH 03/14] Use disk/network common attributes for io direction Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 36 +++++++++++++-------------- model/metrics/container.yaml | 42 +++++--------------------------- 2 files changed, 24 insertions(+), 54 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 1b7ef329be..66ee414650 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -23,7 +23,7 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | ### Metric: `container.memory.utilization` @@ -41,28 +41,28 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -### Metric: `container.disk.io.bytes` +### Metric: `container.disk.io` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.disk.io.bytes` | Counter | `By` | Disk bytes for the container. [1] | +| `container.disk.io` | Counter | `By` | Disk bytes for the container. [1] | **[1]:** The total number of bytes read/written successfully (aggregated from all disks). - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `container.disk.io.direction` | string | The disk IO operation's direction | `read`; `write` | Recommended | -| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| `disk.io.direction` | string | The disk IO operation direction. | `read` | Recommended | -`container.disk.io.direction` MUST be one of the following: +`disk.io.direction` MUST be one of the following: | Value | Description | |---|---| @@ -70,30 +70,30 @@ This metric is optional. | `write` | write | -### Metric: `container.network.io.bytes` +### Metric: `container.network.io` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.disk.io.bytes` | Counter | `By` | Network bytes for the container. [1] | +| `container.network.io` | Counter | `By` | Network bytes for the container. [1] | **[1]:** The number of bytes sent/received on all network interfaces by the container. - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`container.id`](../resource/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -| `container.network.io.direction` | string | The Network IO direction | `ingress`; `egress` | Recommended | +| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | +| [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended | -`container.network.io.direction` MUST be one of the following: +`network.io.direction` MUST be one of the following: | Value | Description | |---|---| -| `ingress` | ingress | -| `egress` | egress | +| `transmit` | transmit | +| `receive` | receive | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index b5de053616..a38feb9b51 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -23,24 +23,9 @@ groups: - ref: container.id # container.disk.io.* metrics and attribute group - - id: attributes.container.disk.io - prefix: container.disk.io - type: attribute_group - brief: "Describes Container Disk IO metric attributes" - attributes: - - id: direction - type: - allow_custom_values: false - members: - - id: read - value: 'read' - - id: write - value: 'write' - brief: "The disk IO operation's direction" - examples: [ "read", "write" ] - - id: metric.container.disk.io.bytes + - id: metric.container.disk.io type: metric - metric_name: container.disk.io.bytes + metric_name: container.disk.io brief: "Disk bytes for the container." note: > The total number of bytes read/written @@ -49,27 +34,12 @@ groups: unit: "By" attributes: - ref: container.id - - ref: container.disk.io.direction + - ref: disk.io.direction # container.network.io.* metrics and attribute group - - id: attributes.container.network.io - prefix: container.network.io - type: attribute_group - brief: "Describes Container Network IO metric attributes" - attributes: - - id: direction - type: - allow_custom_values: false - members: - - id: ingress - value: 'ingress' - - id: egress - value: 'egress' - brief: "The Network IO direction" - examples: [ "ingress", "egress" ] - - id: metric.container.network.io.bytes + - id: metric.container.network.io type: metric - metric_name: container.disk.io.bytes + metric_name: container.network.io brief: "Network bytes for the container." note: > The number of bytes sent/received @@ -79,4 +49,4 @@ groups: unit: "By" attributes: - ref: container.id - - ref: container.network.io.direction + - ref: network.io.direction From 517d95205064e8c06a4a26aa2e19ab9d20aa7a94 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 23 Nov 2023 11:32:30 +0000 Subject: [PATCH 04/14] regenerate tables Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 66ee414650..d8d9f54029 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -60,7 +60,7 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -| `disk.io.direction` | string | The disk IO operation direction. | `read` | Recommended | +| [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended | `disk.io.direction` MUST be one of the following: From 3ddb816babd4634cc8f0be90eaf5023b344cd325 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 25 Jan 2024 12:18:04 +0200 Subject: [PATCH 05/14] Conclude on cpu.time and memory.usage Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 25 +++++++++++------ model/metrics/container.yaml | 48 ++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index d8d9f54029..3c213fa30b 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -12,33 +12,42 @@ linkTitle: Container This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.cpu.utilization` | Gauge | `1` | Recent CPU utilization for the container. [1] | +| `container.cpu.time` | Counter | `ns` | Total CPU time consumed [1] | -**[1]:** CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0]. +**[1]:** Total CPU time consumed by the specific container. - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| +| `container.cpu.state` | string | The state of the CPU | `user`; `kernel` | Opt-In | | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | + +`container.cpu.state` MUST be one of the following: + +| Value | Description | +|---|---| +| `user` | user | +| `system` | system | +| `kernel` | kernel | ### Metric: `container.memory.utilization` This metric is optional. - + | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.memory.utilization` | Gauge | `1` | Recent memory utilization for the container. [1] | +| `container.memory.usage` | Counter | `By` | Memory usage of the container. [1] | -**[1]:** Memory usage percentage. The value range is [0.0,1.0]. +**[1]:** Memory usage of the container. - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index a38feb9b51..3e18bbbe5c 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -1,24 +1,44 @@ groups: - - id: metric.container.cpu.utilization + # container.cpu.* metrics and attribute group + - id: attributes.container.cpu + prefix: container.cpu + type: attribute_group + brief: "Describes Container CPU metric attributes" + attributes: + - id: state + type: + allow_custom_values: false + members: + - id: user + value: 'user' + - id: system + value: 'system' + - id: kernel + value: 'kernel' + brief: "The state of the CPU" + examples: ["user", "kernel"] + - id: metric.container.cpu.time type: metric - metric_name: container.cpu.utilization - brief: "Recent CPU utilization for the container." + metric_name: container.cpu.time + brief: "Total CPU time consumed" note: > - CPU usage percentage normalized by the number of CPU cores. - The value range is [0.0,1.0]. - instrument: gauge - unit: "1" + Total CPU time consumed by the specific container. + instrument: counter + unit: "ns" attributes: + - ref: container.cpu.state + requirement_level: opt_in - ref: container.id - - id: metric.container.memory.utilization + + # container.memory.* metrics and attribute group + - id: metric.container.memory.usage type: metric - metric_name: container.memory.utilization - brief: "Recent memory utilization for the container." + metric_name: container.memory.usage + brief: "Memory usage of the container." note: > - Memory usage percentage. - The value range is [0.0,1.0]. - instrument: gauge - unit: "1" + Memory usage of the container. + instrument: counter + unit: "By" attributes: - ref: container.id From 9accca5d0c8652d11152cc12a287675a048d52a4 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 1 Feb 2024 10:36:07 +0200 Subject: [PATCH 06/14] Add brief note for the states Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 8 ++++---- model/metrics/container.yaml | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 3c213fa30b..d0a3abfffe 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -23,16 +23,16 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `container.cpu.state` | string | The state of the CPU | `user`; `kernel` | Opt-In | +| `container.cpu.state` | 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 | | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | `container.cpu.state` MUST be one of the following: | Value | Description | |---|---| -| `user` | user | -| `system` | system | -| `kernel` | kernel | +| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | +| `system` | When CPU is used by the system | +| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | ### Metric: `container.memory.utilization` diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index 3e18bbbe5c..c48d6113e5 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -6,16 +6,19 @@ groups: brief: "Describes Container CPU metric attributes" attributes: - id: state + brief: "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." type: allow_custom_values: false members: - id: user value: 'user' + brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)." - id: system value: 'system' + brief: "When CPU is used by the system" - id: kernel value: 'kernel' - brief: "The state of the CPU" + brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)." examples: ["user", "kernel"] - id: metric.container.cpu.time type: metric From 945ddc81d999e7a304dd5a3bac5e6ae5e994712d Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 6 Feb 2024 11:13:01 +0200 Subject: [PATCH 07/14] move changelog entry to .chloggen Signed-off-by: ChrsMark --- .chloggen/add_new_container_metrics.yaml | 21 +++++++++++++++++++++ CHANGELOG.md | 2 -- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .chloggen/add_new_container_metrics.yaml diff --git a/.chloggen/add_new_container_metrics.yaml b/.chloggen/add_new_container_metrics.yaml new file mode 100644 index 0000000000..4e6c71bb49 --- /dev/null +++ b/.chloggen/add_new_container_metrics.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: "enhancement" + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: "container" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add new container metrics for `cpu`, `memory`, `disk` and `network`" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [282, 72] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d0a55865..7537d61028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -364,8 +364,6 @@ stabilized. - Make `network.protocol.name|version` description consistent between HTTP spans and metrics. ([#367](https://github.com/open-telemetry/semantic-conventions/pull/367)) -- Add container metric fields (from ECS). - ([#282](https://github.com/open-telemetry/semantic-conventions/pull/282)) ## v1.21.0 (2023-07-13) From 1383648e03af33cece2e843b03ce44d5cbab2e97 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 8 Feb 2024 10:26:38 +0200 Subject: [PATCH 08/14] add clarification on system cpu state Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 2 +- model/metrics/container.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index d0a3abfffe..8deec83022 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -31,7 +31,7 @@ This metric is optional. | Value | Description | |---|---| | `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | -| `system` | When CPU is used by the system | +| `system` | When CPU is used by the system (host OS) | | `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index c48d6113e5..a36d296fd7 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -15,7 +15,7 @@ groups: brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)." - id: system value: 'system' - brief: "When CPU is used by the system" + brief: "When CPU is used by the system (host OS)" - id: kernel value: 'kernel' brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)." From e4ea3f4e3614dd5f16e8bdbad3a6cb46036c09a5 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 21 Feb 2024 11:37:56 +0200 Subject: [PATCH 09/14] address review comments Signed-off-by: ChrsMark --- docs/attributes-registry/container.md | 14 ++++++++++++++ docs/system/container-metrics.md | 10 ++++++---- model/metrics/container.yaml | 22 ++-------------------- model/registry/container.yaml | 20 ++++++++++++++++++++ 4 files changed, 42 insertions(+), 24 deletions(-) diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index d9f66e67f9..49b78da1f2 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -28,3 +28,17 @@ The ID is assinged by the container runtime and can vary in different environmen **[3]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. + + +| Attribute | Type | Description | Examples | +|---|---|---|---| +| `container.cpu.state` | 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` | + +`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. + +| Value | Description | +|---|---| +| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | +| `system` | When CPU is used by the system (host OS) | +| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | + \ No newline at end of file diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 8deec83022..d829497e19 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -8,7 +8,7 @@ linkTitle: Container ## Container Metrics -### Metric: `container.cpu.utilization` +### Metric: `container.cpu.time` This metric is optional. @@ -23,10 +23,10 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `container.cpu.state` | 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 | +| [`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 | | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | -`container.cpu.state` MUST be one of the following: +`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. | Value | Description | |---|---| @@ -35,7 +35,7 @@ This metric is optional. | `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | -### Metric: `container.memory.utilization` +### Metric: `container.memory.usage` This metric is optional. @@ -70,6 +70,7 @@ This metric is optional. |---|---|---|---|---| | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | | [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended | +| `system.device` | string | The device identifier | `(identifier)` | Recommended | `disk.io.direction` MUST be one of the following: @@ -96,6 +97,7 @@ This metric is optional. |---|---|---|---|---| | [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | | [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended | +| `system.device` | string | The device identifier | `(identifier)` | Recommended | `network.io.direction` MUST be one of the following: diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index a36d296fd7..2f31719177 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -1,25 +1,5 @@ groups: # container.cpu.* metrics and attribute group - - id: attributes.container.cpu - prefix: container.cpu - type: attribute_group - brief: "Describes Container CPU metric attributes" - attributes: - - id: state - brief: "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." - type: - allow_custom_values: false - members: - - id: user - value: 'user' - brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)." - - id: system - value: 'system' - brief: "When CPU is used by the system (host OS)" - - id: kernel - value: 'kernel' - brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)." - examples: ["user", "kernel"] - id: metric.container.cpu.time type: metric metric_name: container.cpu.time @@ -58,6 +38,7 @@ groups: attributes: - ref: container.id - ref: disk.io.direction + - ref: system.device # container.network.io.* metrics and attribute group - id: metric.container.network.io @@ -73,3 +54,4 @@ groups: attributes: - ref: container.id - ref: network.io.direction + - ref: system.device diff --git a/model/registry/container.yaml b/model/registry/container.yaml index 343c63b927..9bdcdda6e8 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -95,3 +95,23 @@ groups: brief: > Container labels, `` being the label name, the value being the label value. examples: [ 'container.label.app=nginx' ] + - id: registry.container.cpu + prefix: container.cpu + type: attribute_group + brief: "Describes Container CPU metric attributes" + attributes: + - id: state + brief: "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." + type: + allow_custom_values: true + members: + - id: user + value: 'user' + brief: "When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)." + - id: system + value: 'system' + brief: "When CPU is used by the system (host OS)" + - id: kernel + value: 'kernel' + brief: "When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)." + examples: ["user", "kernel"] From 8732fa710d601807b02bf8de81a9034c1cc34f92 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 28 Feb 2024 11:32:27 +0200 Subject: [PATCH 10/14] change cpu.time unit to seconds Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 2 +- model/metrics/container.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index d829497e19..afcca02da0 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -15,7 +15,7 @@ This metric is optional. | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `container.cpu.time` | Counter | `ns` | Total CPU time consumed [1] | +| `container.cpu.time` | Counter | `s` | Total CPU time consumed [1] | **[1]:** Total CPU time consumed by the specific container. diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index 2f31719177..d8e6984241 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -7,7 +7,7 @@ groups: note: > Total CPU time consumed by the specific container. instrument: counter - unit: "ns" + unit: "s" attributes: - ref: container.cpu.state requirement_level: opt_in From 616752173007cbc5ff9e83146364d4ce99ca86bc Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 28 Feb 2024 11:34:58 +0200 Subject: [PATCH 11/14] fix note for CPU cores consumption Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 2 +- model/metrics/container.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index afcca02da0..8a528baaa6 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -17,7 +17,7 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | | `container.cpu.time` | Counter | `s` | Total CPU time consumed [1] | -**[1]:** Total CPU time consumed by the specific container. +**[1]:** Total CPU time consumed by the specific container on all available CPU cores diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index d8e6984241..f4d1e5f331 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -5,7 +5,7 @@ groups: metric_name: container.cpu.time brief: "Total CPU time consumed" note: > - Total CPU time consumed by the specific container. + Total CPU time consumed by the specific container on all available CPU cores instrument: counter unit: "s" attributes: From bf9b78d2521dfa413bafd5579cd615f0b29d3770 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 28 Feb 2024 11:38:13 +0200 Subject: [PATCH 12/14] remove ref to container.id Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 6 ------ model/metrics/container.yaml | 5 ----- 2 files changed, 11 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 8a528baaa6..dd00823234 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -24,7 +24,6 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`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 | -| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | `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. @@ -48,9 +47,6 @@ This metric is optional. -| Attribute | Type | Description | Examples | Requirement Level | -|---|---|---|---|---| -| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | ### Metric: `container.disk.io` @@ -68,7 +64,6 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | | [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended | | `system.device` | string | The device identifier | `(identifier)` | Recommended | @@ -95,7 +90,6 @@ This metric is optional. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| [`container.id`](../attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | Recommended | | [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended | | `system.device` | string | The device identifier | `(identifier)` | Recommended | diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index f4d1e5f331..d220c571fb 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -11,7 +11,6 @@ groups: attributes: - ref: container.cpu.state requirement_level: opt_in - - ref: container.id # container.memory.* metrics and attribute group - id: metric.container.memory.usage @@ -22,8 +21,6 @@ groups: Memory usage of the container. instrument: counter unit: "By" - attributes: - - ref: container.id # container.disk.io.* metrics and attribute group - id: metric.container.disk.io @@ -36,7 +33,6 @@ groups: instrument: counter unit: "By" attributes: - - ref: container.id - ref: disk.io.direction - ref: system.device @@ -52,6 +48,5 @@ groups: instrument: counter unit: "By" attributes: - - ref: container.id - ref: network.io.direction - ref: system.device From 9f1a8f0527f376fbb0d3718efc56fd9aa8dd0a83 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Wed, 13 Mar 2024 11:40:33 +0100 Subject: [PATCH 13/14] flatten registry Signed-off-by: ChrsMark --- docs/attributes-registry/container.md | 9 ++------- model/registry/container.yaml | 7 +------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index 49b78da1f2..41e32a76a1 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -11,6 +11,7 @@ | `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | | `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `[otelcontribcol, --config, config.yaml]` | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | +| `container.cpu.state` | 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` | | `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | | `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | | `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | @@ -27,12 +28,6 @@ K8s defines a link to the container registry repository with digest `"imageID": The ID is assinged by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. **[3]:** [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. - - - -| Attribute | Type | Description | Examples | -|---|---|---|---| -| `container.cpu.state` | 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` | `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. @@ -41,4 +36,4 @@ The ID is assinged by the container runtime and can vary in different environmen | `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | | `system` | When CPU is used by the system (host OS) | | `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | - \ No newline at end of file + diff --git a/model/registry/container.yaml b/model/registry/container.yaml index 9bdcdda6e8..bd72aa51e5 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -95,12 +95,7 @@ groups: brief: > Container labels, `` being the label name, the value being the label value. examples: [ 'container.label.app=nginx' ] - - id: registry.container.cpu - prefix: container.cpu - type: attribute_group - brief: "Describes Container CPU metric attributes" - attributes: - - id: state + - id: cpu.state brief: "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." type: allow_custom_values: true From b5aa89a7aa1c05c474988a4638607a81776b35a5 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 21 Mar 2024 12:34:33 +0100 Subject: [PATCH 14/14] address review comments Signed-off-by: ChrsMark --- docs/attributes-registry/container.md | 2 +- docs/system/container-metrics.md | 9 +++++---- model/metrics/container.yaml | 3 ++- model/registry/container.yaml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index 41e32a76a1..4e6ec20847 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -11,7 +11,7 @@ | `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | | `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `[otelcontribcol, --config, config.yaml]` | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | -| `container.cpu.state` | 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` | +| `container.cpu.state` | string | The CPU state for this data point. | `user`; `kernel` | | `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | | `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | | `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index dd00823234..d5df4933b2 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -10,7 +10,7 @@ linkTitle: Container ### Metric: `container.cpu.time` -This metric is optional. +This metric is [opt-in][MetricOptIn]. | Name | Instrument Type | Unit (UCUM) | Description | @@ -36,7 +36,7 @@ This metric is optional. ### Metric: `container.memory.usage` -This metric is optional. +This metric is [opt-in][MetricOptIn]. | Name | Instrument Type | Unit (UCUM) | Description | @@ -51,7 +51,7 @@ This metric is optional. ### Metric: `container.disk.io` -This metric is optional. +This metric is [opt-in][MetricOptIn]. | Name | Instrument Type | Unit (UCUM) | Description | @@ -77,7 +77,7 @@ This metric is optional. ### Metric: `container.network.io` -This metric is optional. +This metric is [opt-in][MetricOptIn]. | Name | Instrument Type | Unit (UCUM) | Description | @@ -102,3 +102,4 @@ This metric is optional. [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md +[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in diff --git a/model/metrics/container.yaml b/model/metrics/container.yaml index d220c571fb..3904f168be 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -10,9 +10,10 @@ groups: unit: "s" attributes: - ref: container.cpu.state + brief: "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." requirement_level: opt_in - # container.memory.* metrics and attribute group + # container.memory.* metrics and attribute group - id: metric.container.memory.usage type: metric metric_name: container.memory.usage diff --git a/model/registry/container.yaml b/model/registry/container.yaml index bd72aa51e5..2878766b66 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -96,7 +96,7 @@ groups: Container labels, `` being the label name, the value being the label value. examples: [ 'container.label.app=nginx' ] - id: cpu.state - brief: "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." + brief: "The CPU state for this data point." type: allow_custom_values: true members: