Skip to content

Commit

Permalink
Update naming and add attributes
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 113808a commit 19c8c0e
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 73 deletions.
85 changes: 43 additions & 42 deletions docs/system/container-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,94 +8,95 @@ linkTitle: Container

## Container Metrics

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

This metric is optional.

<!-- semconv metric.container.cpu.usage(metric_table) -->
<!-- semconv metric.container.cpu.utilization(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.cpu.usage` | Gauge | `1` | Recent CPU utilization for the container. [1] |
| `container.cpu.utilization` | 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) -->
<!-- semconv metric.container.cpu.utilization(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`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 |
<!-- endsemconv -->

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

This metric is optional.

<!-- semconv metric.container.memory.usage(metric_table) -->
<!-- semconv metric.container.memory.utilization(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `container.memory.usage` | Gauge | `1` | Recent memory utilization for the container. [1] |
| `container.memory.utilization` | 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) -->
<!-- semconv metric.container.memory.utilization(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`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 |
<!-- endsemconv -->

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

This metric is optional.

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

**[1]:** The total number of bytes read successfully (aggregated from all disks).
**[1]:** The total number of bytes read/written 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.io.bytes(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `container.disk.io.direction` | string | The disk IO operation's direction | `read`; `write` | Recommended |
| [`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 |

<!-- 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] |
`container.disk.io.direction` MUST be one of the following:

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

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

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

This metric is optional.

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

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

<!-- semconv metric.container.network.ingress.bytes(full) -->
<!-- endsemconv -->
<!-- semconv metric.container.network.io.bytes(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`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 |
| `container.network.io.direction` | string | The Network IO direction | `ingress`; `egress` | Recommended |

### Metric: `container.network.egress.bytes`
`container.network.io.direction` MUST be one of the following:

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.
| Value | Description |
|---|---|
| `ingress` | ingress |
| `egress` | egress |
<!-- 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
87 changes: 56 additions & 31 deletions model/metrics/container.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,82 @@
groups:
- id: metric.container.cpu.usage
- id: metric.container.cpu.utilization
type: metric
metric_name: container.cpu.usage
metric_name: container.cpu.utilization
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
attributes:
- ref: container.id
- id: metric.container.memory.utilization
type: metric
metric_name: container.memory.usage
metric_name: container.memory.utilization
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
attributes:
- ref: container.id

# container.disk.io.* metrics and attribute group
- id: attributes.container.disk.io
prefix: container.disk.io
type: attribute_group
brief: "Describes Container Disk IO metric attributes"
attributes:
- id: direction
type:
allow_custom_values: false
members:
- id: read
value: 'read'
- id: write
value: 'write'
brief: "The disk IO operation's direction"
examples: [ "read", "write" ]
- id: metric.container.disk.io.bytes
type: metric
metric_name: container.disk.read.bytes
brief: "Disk read bytes for the container."
metric_name: container.disk.io.bytes
brief: "Disk bytes for the container."
note: >
The total number of bytes read
The total number of bytes read/written
successfully (aggregated from all disks).
instrument: counter
unit: "By"
- id: metric.container.disk.write.bytes
attributes:
- ref: container.id
- ref: container.disk.io.direction

# container.network.io.* metrics and attribute group
- id: attributes.container.network.io
prefix: container.network.io
type: attribute_group
brief: "Describes Container Network IO metric attributes"
attributes:
- id: direction
type:
allow_custom_values: false
members:
- id: ingress
value: 'ingress'
- id: egress
value: 'egress'
brief: "The Network IO direction"
examples: [ "ingress", "egress" ]
- id: metric.container.network.io.bytes
type: metric
metric_name: container.disk.write.bytes
brief: "Disk write bytes for the container."
metric_name: container.disk.io.bytes
brief: "Network 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
The number of bytes sent/received
on all network interfaces
by the container.
instrument: counter
unit: "By"
attributes:
- ref: container.id
- ref: container.network.io.direction

Check failure on line 82 in model/metrics/container.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[new-line-at-end-of-file] no new line character at the end of file

0 comments on commit 19c8c0e

Please sign in to comment.