-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add container metric fields (from ECS) (#282)
Signed-off-by: ChrsMark <[email protected]> Co-authored-by: Joao Grassi <[email protected]>
- Loading branch information
1 parent
4368358
commit 0941ebb
Showing
5 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
# | ||
# If your change doesn't affect end users you should instead start | ||
# your pull request title with [chore] or use the "Skip Changelog" label. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: "enhancement" | ||
|
||
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) | ||
component: "container" | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Add new container metrics for `cpu`, `memory`, `disk` and `network`" | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [282, 72] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!--- 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.time` | ||
|
||
This metric is [opt-in][MetricOptIn]. | ||
|
||
<!-- semconv metric.container.cpu.time(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `container.cpu.time` | Counter | `s` | Total CPU time consumed [1] | | ||
|
||
**[1]:** Total CPU time consumed by the specific container on all available CPU cores | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.container.cpu.time(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| [`container.cpu.state`](../attributes-registry/container.md) | string | The CPU state for this data point. A container SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels. | `user`; `kernel` | Opt-In | | ||
|
||
`container.cpu.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used. | ||
|
||
| Value | Description | | ||
|---|---| | ||
| `user` | When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows). | | ||
| `system` | When CPU is used by the system (host OS) | | ||
| `kernel` | When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows). | | ||
<!-- endsemconv --> | ||
|
||
### Metric: `container.memory.usage` | ||
|
||
This metric is [opt-in][MetricOptIn]. | ||
|
||
<!-- semconv metric.container.memory.usage(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `container.memory.usage` | Counter | `By` | Memory usage of the container. [1] | | ||
|
||
**[1]:** Memory usage of the container. | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.container.memory.usage(full) --> | ||
<!-- endsemconv --> | ||
|
||
### Metric: `container.disk.io` | ||
|
||
This metric is [opt-in][MetricOptIn]. | ||
|
||
<!-- semconv metric.container.disk.io(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `container.disk.io` | Counter | `By` | Disk bytes for the container. [1] | | ||
|
||
**[1]:** The total number of bytes read/written successfully (aggregated from all disks). | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.container.disk.io(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| [`disk.io.direction`](../attributes-registry/disk.md) | string | The disk IO operation direction. | `read` | Recommended | | ||
| `system.device` | string | The device identifier | `(identifier)` | Recommended | | ||
|
||
`disk.io.direction` MUST be one of the following: | ||
|
||
| Value | Description | | ||
|---|---| | ||
| `read` | read | | ||
| `write` | write | | ||
<!-- endsemconv --> | ||
|
||
### Metric: `container.network.io` | ||
|
||
This metric is [opt-in][MetricOptIn]. | ||
|
||
<!-- semconv metric.container.network.io(metric_table) --> | ||
| Name | Instrument Type | Unit (UCUM) | Description | | ||
| -------- | --------------- | ----------- | -------------- | | ||
| `container.network.io` | Counter | `By` | Network bytes for the container. [1] | | ||
|
||
**[1]:** The number of bytes sent/received on all network interfaces by the container. | ||
<!-- endsemconv --> | ||
|
||
<!-- semconv metric.container.network.io(full) --> | ||
| Attribute | Type | Description | Examples | Requirement Level | | ||
|---|---|---|---|---| | ||
| [`network.io.direction`](../attributes-registry/network.md) | string | The network IO operation direction. | `transmit` | Recommended | | ||
| `system.device` | string | The device identifier | `(identifier)` | Recommended | | ||
|
||
`network.io.direction` MUST be one of the following: | ||
|
||
| Value | Description | | ||
|---|---| | ||
| `transmit` | transmit | | ||
| `receive` | receive | | ||
<!-- endsemconv --> | ||
|
||
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/document-status.md | ||
[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
groups: | ||
# container.cpu.* metrics and attribute group | ||
- id: metric.container.cpu.time | ||
type: metric | ||
metric_name: container.cpu.time | ||
brief: "Total CPU time consumed" | ||
note: > | ||
Total CPU time consumed by the specific container on all available CPU cores | ||
instrument: counter | ||
unit: "s" | ||
attributes: | ||
- ref: container.cpu.state | ||
brief: "The CPU state for this data point. A container SHOULD be characterized _either_ by data points with no `state` labels, _or only_ data points with `state` labels." | ||
requirement_level: opt_in | ||
|
||
# container.memory.* metrics and attribute group | ||
- id: metric.container.memory.usage | ||
type: metric | ||
metric_name: container.memory.usage | ||
brief: "Memory usage of the container." | ||
note: > | ||
Memory usage of the container. | ||
instrument: counter | ||
unit: "By" | ||
|
||
# container.disk.io.* metrics and attribute group | ||
- id: metric.container.disk.io | ||
type: metric | ||
metric_name: container.disk.io | ||
brief: "Disk bytes for the container." | ||
note: > | ||
The total number of bytes read/written | ||
successfully (aggregated from all disks). | ||
instrument: counter | ||
unit: "By" | ||
attributes: | ||
- ref: disk.io.direction | ||
- ref: system.device | ||
|
||
# container.network.io.* metrics and attribute group | ||
- id: metric.container.network.io | ||
type: metric | ||
metric_name: container.network.io | ||
brief: "Network bytes for the container." | ||
note: > | ||
The number of bytes sent/received | ||
on all network interfaces | ||
by the container. | ||
instrument: counter | ||
unit: "By" | ||
attributes: | ||
- ref: network.io.direction | ||
- ref: system.device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters