Skip to content

Commit

Permalink
Conclude on cpu.time and memory.usage
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark committed Jan 25, 2024
1 parent 743bac3 commit 1dbff5f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 22 deletions.
26 changes: 18 additions & 8 deletions docs/system/container-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,43 @@ linkTitle: Container

This metric is optional.

<!-- semconv metric.container.cpu.utilization(metric_table) -->
<!-- semconv metric.container.cpu.time(metric_table) -->
| 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.
<!-- endsemconv -->

<!-- semconv metric.container.cpu.utilization(full) -->
<!-- semconv metric.container.cpu.time(full) -->
| 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 |
<!-- endsemconv -->

### Metric: `container.memory.utilization`

This metric is optional.

<!-- semconv metric.container.memory.utilization(metric_table) -->
<!-- semconv metric.container.memory.usage(metric_table) -->
| 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.
<!-- endsemconv -->

<!-- semconv metric.container.memory.utilization(full) -->
<!-- semconv metric.container.memory.usage(full) -->
| 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 |
Expand Down
54 changes: 40 additions & 14 deletions model/metrics/container.yaml
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 39 in model/metrics/container.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[comments-indentation] comment not indented like content
- 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

Expand Down

0 comments on commit 1dbff5f

Please sign in to comment.