Skip to content

Commit 775a7d1

Browse files
committed
Update naming and add attributes
Signed-off-by: ChrsMark <[email protected]>
1 parent 113808a commit 775a7d1

File tree

2 files changed

+98
-75
lines changed

2 files changed

+98
-75
lines changed

docs/system/container-metrics.md

+42-44
Original file line numberDiff line numberDiff line change
@@ -8,94 +8,92 @@ linkTitle: Container
88

99
## Container Metrics
1010

11-
### Metric: `container.cpu.usage`
11+
### Metric: `container.cpu.utilization`
1212

1313
This metric is optional.
1414

15-
<!-- semconv metric.container.cpu.usage(metric_table) -->
15+
<!-- semconv metric.container.cpu.utilization(metric_table) -->
1616
| Name | Instrument Type | Unit (UCUM) | Description |
1717
| -------- | --------------- | ----------- | -------------- |
18-
| `container.cpu.usage` | Gauge | `1` | Recent CPU utilization for the container. [1] |
18+
| `container.cpu.utilization` | Gauge | `1` | Recent CPU utilization for the container. [1] |
1919

2020
**[1]:** CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0].
2121
<!-- endsemconv -->
2222

23-
<!-- semconv metric.container.cpu.usage(full) -->
23+
<!-- semconv metric.container.cpu.utilization(full) -->
24+
| Attribute | Type | Description | Examples | Requirement Level |
25+
|---|---|---|---|---|
26+
| [`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 |
2427
<!-- endsemconv -->
2528

26-
### Metric: `container.memory.usage`
29+
### Metric: `container.memory.utilization`
2730

2831
This metric is optional.
2932

30-
<!-- semconv metric.container.memory.usage(metric_table) -->
33+
<!-- semconv metric.container.memory.utilization(metric_table) -->
3134
| Name | Instrument Type | Unit (UCUM) | Description |
3235
| -------- | --------------- | ----------- | -------------- |
33-
| `container.memory.usage` | Gauge | `1` | Recent memory utilization for the container. [1] |
36+
| `container.memory.utilization` | Gauge | `1` | Recent memory utilization for the container. [1] |
3437

3538
**[1]:** Memory usage percentage. The value range is [0.0,1.0].
3639
<!-- endsemconv -->
3740

38-
<!-- semconv metric.container.memory.usage(full) -->
41+
<!-- semconv metric.container.memory.utilization(full) -->
42+
| Attribute | Type | Description | Examples | Requirement Level |
43+
|---|---|---|---|---|
44+
| [`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 |
3945
<!-- endsemconv -->
4046

41-
### Metric: `container.disk.read.bytes`
47+
### Metric: `container.disk.io.bytes`
4248

4349
This metric is optional.
4450

45-
<!-- semconv metric.container.disk.read.bytes(metric_table) -->
51+
<!-- semconv metric.container.disk.io.bytes(metric_table) -->
4652
| Name | Instrument Type | Unit (UCUM) | Description |
4753
| -------- | --------------- | ----------- | -------------- |
48-
| `container.disk.read.bytes` | Counter | `By` | Disk read bytes for the container. [1] |
54+
| `container.disk.io.bytes` | Counter | `By` | Disk bytes for the container. [1] |
4955

50-
**[1]:** The total number of bytes read successfully (aggregated from all disks).
56+
**[1]:** The total number of bytes read/written successfully (aggregated from all disks).
5157
<!-- endsemconv -->
5258

53-
<!-- semconv metric.container.disk.read.bytes(full) -->
54-
<!-- endsemconv -->
55-
56-
### Metric: `container.disk.write.bytes`
57-
58-
This metric is optional.
59+
<!-- semconv metric.container.disk.io.bytes(full) -->
60+
| Attribute | Type | Description | Examples | Requirement Level |
61+
|---|---|---|---|---|
62+
| `container.disk.io.direction` | string | The disk IO operation's direction | `read`; `write` | Recommended |
63+
| [`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 |
5964

60-
<!-- semconv metric.container.disk.write.bytes(metric_table) -->
61-
| Name | Instrument Type | Unit (UCUM) | Description |
62-
| -------- | --------------- | ----------- | -------------- |
63-
| `container.disk.write.bytes` | Counter | `By` | Disk write bytes for the container. [1] |
64-
65-
**[1]:** The total number of bytes written successfully (aggregated from all disks).
66-
<!-- endsemconv -->
65+
`container.disk.io.direction` MUST be one of the following:
6766

68-
<!-- semconv metric.container.disk.write.bytes(full) -->
67+
| Value | Description |
68+
|---|---|
69+
| `read` | read |
70+
| `write` | write |
6971
<!-- endsemconv -->
7072

71-
### Metric: `container.network.ingress.bytes`
73+
### Metric: `container.network.io.bytes`
7274

7375
This metric is optional.
7476

75-
<!-- semconv metric.container.network.ingress.bytes(metric_table) -->
77+
<!-- semconv metric.container.network.io.bytes(metric_table) -->
7678
| Name | Instrument Type | Unit (UCUM) | Description |
7779
| -------- | --------------- | ----------- | -------------- |
78-
| `container.network.ingress.bytes` | Counter | `By` | Network ingress bytes for the container. [1] |
80+
| `container.disk.io.bytes` | Counter | `By` | Network bytes for the container. [1] |
7981

80-
**[1]:** The number of bytes received on all network interfaces by the container.
82+
**[1]:** The number of bytes sent/received on all network interfaces by the container.
8183
<!-- endsemconv -->
8284

83-
<!-- semconv metric.container.network.ingress.bytes(full) -->
84-
<!-- endsemconv -->
85-
86-
### Metric: `container.network.egress.bytes`
87-
88-
This metric is optional.
85+
<!-- semconv metric.container.network.io.bytes(full) -->
86+
| Attribute | Type | Description | Examples | Requirement Level |
87+
|---|---|---|---|---|
88+
| [`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 |
89+
| `container.network.io.direction` | string | The Network IO direction | `ingress`; `egress` | Recommended |
8990

90-
<!-- semconv metric.container.network.egress.bytes(metric_table) -->
91-
| Name | Instrument Type | Unit (UCUM) | Description |
92-
| -------- | --------------- | ----------- | -------------- |
93-
| `container.network.egress.bytes` | Counter | `By` | Network egress bytes for the container. [1] |
94-
95-
**[1]:** The number of bytes sent out on all network interfaces by the container.
96-
<!-- endsemconv -->
91+
`container.network.io.direction` MUST be one of the following:
9792

98-
<!-- semconv metric.container.network.egress.bytes(full) -->
93+
| Value | Description |
94+
|---|---|
95+
| `ingress` | ingress |
96+
| `egress` | egress |
9997
<!-- endsemconv -->
10098

10199
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

model/metrics/container.yaml

+56-31
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,82 @@
11
groups:
2-
- id: metric.container.cpu.usage
2+
- id: metric.container.cpu.utilization
33
type: metric
4-
metric_name: container.cpu.usage
4+
metric_name: container.cpu.utilization
55
brief: "Recent CPU utilization for the container."
66
note: >
77
CPU usage percentage normalized by the number of CPU cores.
88
The value range is [0.0,1.0].
99
instrument: gauge
1010
unit: "1"
11-
- id: metric.container.memory.usage
11+
attributes:
12+
- ref: container.id
13+
- id: metric.container.memory.utilization
1214
type: metric
13-
metric_name: container.memory.usage
15+
metric_name: container.memory.utilization
1416
brief: "Recent memory utilization for the container."
1517
note: >
1618
Memory usage percentage.
1719
The value range is [0.0,1.0].
1820
instrument: gauge
1921
unit: "1"
20-
- id: metric.container.disk.read.bytes
22+
attributes:
23+
- ref: container.id
24+
25+
# container.disk.io.* metrics and attribute group
26+
- id: attributes.container.disk.io
27+
prefix: container.disk.io
28+
type: attribute_group
29+
brief: "Describes Container Disk IO metric attributes"
30+
attributes:
31+
- id: direction
32+
type:
33+
allow_custom_values: false
34+
members:
35+
- id: read
36+
value: 'read'
37+
- id: write
38+
value: 'write'
39+
brief: "The disk IO operation's direction"
40+
examples: [ "read", "write" ]
41+
- id: metric.container.disk.io.bytes
2142
type: metric
22-
metric_name: container.disk.read.bytes
23-
brief: "Disk read bytes for the container."
43+
metric_name: container.disk.io.bytes
44+
brief: "Disk bytes for the container."
2445
note: >
25-
The total number of bytes read
46+
The total number of bytes read/written
2647
successfully (aggregated from all disks).
2748
instrument: counter
2849
unit: "By"
29-
- id: metric.container.disk.write.bytes
50+
attributes:
51+
- ref: container.id
52+
- ref: container.disk.io.direction
53+
54+
# container.network.io.* metrics and attribute group
55+
- id: attributes.container.network.io
56+
prefix: container.network.io
57+
type: attribute_group
58+
brief: "Describes Container Network IO metric attributes"
59+
attributes:
60+
- id: direction
61+
type:
62+
allow_custom_values: false
63+
members:
64+
- id: ingress
65+
value: 'ingress'
66+
- id: egress
67+
value: 'egress'
68+
brief: "The Network IO direction"
69+
examples: [ "ingress", "egress" ]
70+
- id: metric.container.network.io.bytes
3071
type: metric
31-
metric_name: container.disk.write.bytes
32-
brief: "Disk write bytes for the container."
72+
metric_name: container.disk.io.bytes
73+
brief: "Network bytes for the container."
3374
note: >
34-
The total number of bytes written
35-
successfully (aggregated from all disks).
36-
instrument: counter
37-
unit: "By"
38-
- id: metric.container.network.ingress.bytes
39-
type: metric
40-
metric_name: container.network.ingress.bytes
41-
brief: "Network ingress bytes for the container."
42-
note: >
43-
The number of bytes received
44-
on all network interfaces
45-
by the container.
46-
instrument: counter
47-
unit: "By"
48-
- id: metric.container.network.egress.bytes
49-
type: metric
50-
metric_name: container.network.egress.bytes
51-
brief: "Network egress bytes for the container."
52-
note: >
53-
The number of bytes sent out
75+
The number of bytes sent/received
5476
on all network interfaces
5577
by the container.
5678
instrument: counter
5779
unit: "By"
80+
attributes:
81+
- ref: container.id
82+
- ref: container.network.io.direction

0 commit comments

Comments
 (0)