Skip to content

Commit 113808a

Browse files
committed
Add container metric fields
Signed-off-by: ChrsMark <[email protected]>
1 parent ea50a0d commit 113808a

File tree

3 files changed

+160
-0
lines changed

3 files changed

+160
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ release.
153153
- Make `network.protocol.name|version` description consistent between HTTP
154154
spans and metrics.
155155
([#367](https://github.com/open-telemetry/semantic-conventions/pull/367))
156+
- Add container metric fields (from ECS).
157+
([#282](https://github.com/open-telemetry/semantic-conventions/pull/282))
156158

157159
## v1.21.0 (2023-07-13)
158160

docs/system/container-metrics.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!--- Hugo front matter used to generate the website version of this page:
2+
linkTitle: Container
3+
--->
4+
5+
# Semantic Conventions for Container Metrics
6+
7+
**Status**: [Experimental][DocumentStatus]
8+
9+
## Container Metrics
10+
11+
### Metric: `container.cpu.usage`
12+
13+
This metric is optional.
14+
15+
<!-- semconv metric.container.cpu.usage(metric_table) -->
16+
| Name | Instrument Type | Unit (UCUM) | Description |
17+
| -------- | --------------- | ----------- | -------------- |
18+
| `container.cpu.usage` | Gauge | `1` | Recent CPU utilization for the container. [1] |
19+
20+
**[1]:** CPU usage percentage normalized by the number of CPU cores. The value range is [0.0,1.0].
21+
<!-- endsemconv -->
22+
23+
<!-- semconv metric.container.cpu.usage(full) -->
24+
<!-- endsemconv -->
25+
26+
### Metric: `container.memory.usage`
27+
28+
This metric is optional.
29+
30+
<!-- semconv metric.container.memory.usage(metric_table) -->
31+
| Name | Instrument Type | Unit (UCUM) | Description |
32+
| -------- | --------------- | ----------- | -------------- |
33+
| `container.memory.usage` | Gauge | `1` | Recent memory utilization for the container. [1] |
34+
35+
**[1]:** Memory usage percentage. The value range is [0.0,1.0].
36+
<!-- endsemconv -->
37+
38+
<!-- semconv metric.container.memory.usage(full) -->
39+
<!-- endsemconv -->
40+
41+
### Metric: `container.disk.read.bytes`
42+
43+
This metric is optional.
44+
45+
<!-- semconv metric.container.disk.read.bytes(metric_table) -->
46+
| Name | Instrument Type | Unit (UCUM) | Description |
47+
| -------- | --------------- | ----------- | -------------- |
48+
| `container.disk.read.bytes` | Counter | `By` | Disk read bytes for the container. [1] |
49+
50+
**[1]:** The total number of bytes read successfully (aggregated from all disks).
51+
<!-- endsemconv -->
52+
53+
<!-- semconv metric.container.disk.read.bytes(full) -->
54+
<!-- endsemconv -->
55+
56+
### Metric: `container.disk.write.bytes`
57+
58+
This metric is optional.
59+
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 -->
67+
68+
<!-- semconv metric.container.disk.write.bytes(full) -->
69+
<!-- endsemconv -->
70+
71+
### Metric: `container.network.ingress.bytes`
72+
73+
This metric is optional.
74+
75+
<!-- semconv metric.container.network.ingress.bytes(metric_table) -->
76+
| Name | Instrument Type | Unit (UCUM) | Description |
77+
| -------- | --------------- | ----------- | -------------- |
78+
| `container.network.ingress.bytes` | Counter | `By` | Network ingress bytes for the container. [1] |
79+
80+
**[1]:** The number of bytes received on all network interfaces by the container.
81+
<!-- endsemconv -->
82+
83+
<!-- semconv metric.container.network.ingress.bytes(full) -->
84+
<!-- endsemconv -->
85+
86+
### Metric: `container.network.egress.bytes`
87+
88+
This metric is optional.
89+
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 -->
97+
98+
<!-- semconv metric.container.network.egress.bytes(full) -->
99+
<!-- endsemconv -->
100+
101+
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md

model/metrics/container.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
groups:
2+
- id: metric.container.cpu.usage
3+
type: metric
4+
metric_name: container.cpu.usage
5+
brief: "Recent CPU utilization for the container."
6+
note: >
7+
CPU usage percentage normalized by the number of CPU cores.
8+
The value range is [0.0,1.0].
9+
instrument: gauge
10+
unit: "1"
11+
- id: metric.container.memory.usage
12+
type: metric
13+
metric_name: container.memory.usage
14+
brief: "Recent memory utilization for the container."
15+
note: >
16+
Memory usage percentage.
17+
The value range is [0.0,1.0].
18+
instrument: gauge
19+
unit: "1"
20+
- id: metric.container.disk.read.bytes
21+
type: metric
22+
metric_name: container.disk.read.bytes
23+
brief: "Disk read bytes for the container."
24+
note: >
25+
The total number of bytes read
26+
successfully (aggregated from all disks).
27+
instrument: counter
28+
unit: "By"
29+
- id: metric.container.disk.write.bytes
30+
type: metric
31+
metric_name: container.disk.write.bytes
32+
brief: "Disk write bytes for the container."
33+
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
54+
on all network interfaces
55+
by the container.
56+
instrument: counter
57+
unit: "By"

0 commit comments

Comments
 (0)