Skip to content

Commit

Permalink
Add container metric fields
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed Oct 13, 2023
1 parent ea50a0d commit 113808a
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ release.
- Make `network.protocol.name|version` description consistent between HTTP
spans and metrics.
([#367](https://github.com/open-telemetry/semantic-conventions/pull/367))
- Add container metric fields (from ECS).
([#282](https://github.com/open-telemetry/semantic-conventions/pull/282))

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

Expand Down
101 changes: 101 additions & 0 deletions docs/system/container-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Container
--->

# Semantic Conventions for Container Metrics

**Status**: [Experimental][DocumentStatus]

## Container Metrics

### Metric: `container.cpu.usage`

This metric is optional.

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

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

<!-- semconv metric.container.cpu.usage(full) -->
<!-- endsemconv -->

### Metric: `container.memory.usage`

This metric is optional.

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

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

<!-- semconv metric.container.memory.usage(full) -->
<!-- endsemconv -->

### Metric: `container.disk.read.bytes`

This metric is optional.

<!-- semconv metric.container.disk.read.bytes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.disk.read.bytes` | Counter | `By` | Disk read bytes for the container. [1] |

**[1]:** The total number of bytes read successfully (aggregated from all disks).
<!-- endsemconv -->

<!-- semconv metric.container.disk.read.bytes(full) -->
<!-- endsemconv -->

### Metric: `container.disk.write.bytes`

This metric is optional.

<!-- semconv metric.container.disk.write.bytes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.disk.write.bytes` | Counter | `By` | Disk write bytes for the container. [1] |

**[1]:** The total number of bytes written successfully (aggregated from all disks).
<!-- endsemconv -->

<!-- semconv metric.container.disk.write.bytes(full) -->
<!-- endsemconv -->

### Metric: `container.network.ingress.bytes`

This metric is optional.

<!-- semconv metric.container.network.ingress.bytes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.network.ingress.bytes` | Counter | `By` | Network ingress bytes for the container. [1] |

**[1]:** The number of bytes received on all network interfaces by the container.
<!-- endsemconv -->

<!-- semconv metric.container.network.ingress.bytes(full) -->
<!-- endsemconv -->

### Metric: `container.network.egress.bytes`

This metric is optional.

<!-- semconv metric.container.network.egress.bytes(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.network.egress.bytes` | Counter | `By` | Network egress bytes for the container. [1] |

**[1]:** The number of bytes sent out on all network interfaces by the container.
<!-- endsemconv -->

<!-- semconv metric.container.network.egress.bytes(full) -->
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md
57 changes: 57 additions & 0 deletions model/metrics/container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
groups:
- id: metric.container.cpu.usage
type: metric
metric_name: container.cpu.usage
brief: "Recent CPU utilization for the container."
note: >
CPU usage percentage normalized by the number of CPU cores.
The value range is [0.0,1.0].
instrument: gauge
unit: "1"
- id: metric.container.memory.usage
type: metric
metric_name: container.memory.usage
brief: "Recent memory utilization for the container."
note: >
Memory usage percentage.
The value range is [0.0,1.0].
instrument: gauge
unit: "1"
- id: metric.container.disk.read.bytes
type: metric
metric_name: container.disk.read.bytes
brief: "Disk read bytes for the container."
note: >
The total number of bytes read
successfully (aggregated from all disks).
instrument: counter
unit: "By"
- id: metric.container.disk.write.bytes
type: metric
metric_name: container.disk.write.bytes
brief: "Disk write bytes for the container."
note: >
The total number of bytes written
successfully (aggregated from all disks).
instrument: counter
unit: "By"
- id: metric.container.network.ingress.bytes
type: metric
metric_name: container.network.ingress.bytes
brief: "Network ingress bytes for the container."
note: >
The number of bytes received
on all network interfaces
by the container.
instrument: counter
unit: "By"
- id: metric.container.network.egress.bytes
type: metric
metric_name: container.network.egress.bytes
brief: "Network egress bytes for the container."
note: >
The number of bytes sent out
on all network interfaces
by the container.
instrument: counter
unit: "By"

0 comments on commit 113808a

Please sign in to comment.