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 2288c39e52..bdca02bd8d 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -84,3 +84,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"] \ No newline at end of file