Skip to content

Latest commit

 

History

History
224 lines (163 loc) · 10.8 KB

container-metrics.md

File metadata and controls

224 lines (163 loc) · 10.8 KB

Semantic conventions for container metrics

Status: Development

Container Metrics

This document describes instruments and attributes for common container level metrics in OpenTelemetry. These metrics are collected from technology-specific, well-defined APIs (e.g. Kubelet's API or container runtimes).

Metric: container.uptime

This metric is recommended.

Name Instrument Type Unit (UCUM) Description Stability
container.uptime Gauge s The time the container has been running [1] Development

[1]: Instrumentations SHOULD use a gauge with type double and measure uptime in seconds as a floating point number with the highest precision available. The actual accuracy would depend on the instrumentation and operating system.

Metric: container.cpu.time

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
container.cpu.time Counter s Total CPU time consumed [1] Development

[1]: Total CPU time consumed by the specific container on all available CPU cores

Attribute Type Description Examples Requirement Level Stability
cpu.mode string The CPU mode for this data point. A container's CPU metric SHOULD be characterized either by data points with no mode labels, or only data points with mode labels. [1] user; system Conditionally Required [2] Development

[1] cpu.mode: Following states SHOULD be used: user, system, kernel

[2] cpu.mode: Required if mode is available, i.e. metrics coming from the Docker Stats API.


cpu.mode 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 Stability
idle idle Development
interrupt interrupt Development
iowait iowait Development
kernel kernel Development
nice nice Development
steal steal Development
system system Development
user user Development

Metric: container.cpu.usage

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
container.cpu.usage Gauge {cpu} Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] Development

[1]: CPU usage of the specific container on all available CPU cores, averaged over the sample window

Attribute Type Description Examples Requirement Level Stability
cpu.mode string The CPU mode for this data point. A container's CPU metric SHOULD be characterized either by data points with no mode labels, or only data points with mode labels. [1] user; system Conditionally Required [2] Development

[1] cpu.mode: Following states SHOULD be used: user, system, kernel

[2] cpu.mode: Required if mode is available, i.e. metrics coming from the Docker Stats API.


cpu.mode 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 Stability
idle idle Development
interrupt interrupt Development
iowait iowait Development
kernel kernel Development
nice nice Development
steal steal Development
system system Development
user user Development

Metric: container.memory.usage

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
container.memory.usage Counter By Memory usage of the container. [1] Development

[1]: Memory usage of the container.

Metric: container.disk.io

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
container.disk.io Counter By Disk bytes for the container. [1] Development

[1]: The total number of bytes read/written successfully (aggregated from all disks).

Attribute Type Description Examples Requirement Level Stability
disk.io.direction string The disk IO operation direction. read Recommended Development
system.device string The device identifier (identifier) Recommended Development

disk.io.direction 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 Stability
read read Development
write write Development

Metric: container.network.io

This metric is opt-in.

Name Instrument Type Unit (UCUM) Description Stability
container.network.io Counter By Network bytes for the container. [1] Development

[1]: The number of bytes sent/received on all network interfaces by the container.

Attribute Type Description Examples Requirement Level Stability
network.interface.name string The network interface name. lo; eth0 Recommended Development
network.io.direction string The network IO operation direction. transmit Recommended Development

network.io.direction 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 Stability
receive receive Development
transmit transmit Development