diff --git a/docs/system/container-metrics.md b/docs/system/container-metrics.md index d8d9f54029..a428fe3d47 100644 --- a/docs/system/container-metrics.md +++ b/docs/system/container-metrics.md @@ -12,33 +12,43 @@ 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.logical_number` | int | The logical CPU number [0..n-1] | `1` | Opt-In | +| `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..b335d9f39e 100644 --- a/model/metrics/container.yaml +++ b/model/metrics/container.yaml @@ -1,24 +1,50 @@ 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: logical_number + type: int + brief: "The logical CPU number [0..n-1]" + examples: [1] + - 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.cpu.logical_number + 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