From 2b73f9dc528953b656f4588f8979b95c7466de87 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 13 Oct 2023 10:27:54 +0100 Subject: [PATCH] Update naming and add attributes Signed-off-by: ChrsMark --- docs/system/container-metrics.md | 85 ++++++++++++++++--------------- model/metrics/container.yaml | 87 ++++++++++++++++++++------------ 2 files changed, 99 insertions(+), 73 deletions(-) diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index 48947005dd..cd53cb5be6 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -8,94 +8,95 @@ 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] | +`container.disk.io.direction` MUST be one of the following: -**[1]:** The total number of bytes written successfully (aggregated from all disks). +| 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. - - + +| 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 | -### Metric: `container.network.egress.bytes` +`container.network.io.direction` MUST be one of the following: -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. +| 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