Semantic Conventions for Container Metrics

Status: Experimental

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.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.uptimeGaugesThe time the container has been running [1]Experimental

[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.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.cpu.timeCountersTotal CPU time consumed [1]Experimental

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

AttributeTypeDescriptionExamplesRequirement LevelStability
cpu.modestringThe 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; systemConditionally Required [2]Experimental

[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.

ValueDescriptionStability
idleidleExperimental
interruptinterruptExperimental
iowaitiowaitExperimental
kernelkernelExperimental
niceniceExperimental
stealstealExperimental
systemsystemExperimental
useruserExperimental

Metric: container.cpu.usage

This metric is opt-in.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.cpu.usageGauge{cpu}Container’s CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1]Experimental

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

AttributeTypeDescriptionExamplesRequirement LevelStability
cpu.modestringThe 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; systemConditionally Required [2]Experimental

[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.

ValueDescriptionStability
idleidleExperimental
interruptinterruptExperimental
iowaitiowaitExperimental
kernelkernelExperimental
niceniceExperimental
stealstealExperimental
systemsystemExperimental
useruserExperimental

Metric: container.memory.usage

This metric is opt-in.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.memory.usageCounterByMemory usage of the container. [1]Experimental

[1]: Memory usage of the container.

Metric: container.disk.io

This metric is opt-in.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.disk.ioCounterByDisk bytes for the container. [1]Experimental

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

AttributeTypeDescriptionExamplesRequirement LevelStability
disk.io.directionstringThe disk IO operation direction.readRecommendedExperimental
system.devicestringThe device identifier(identifier)RecommendedExperimental

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.

ValueDescriptionStability
readreadExperimental
writewriteExperimental

Metric: container.network.io

This metric is opt-in.

NameInstrument TypeUnit (UCUM)DescriptionStability
container.network.ioCounterByNetwork bytes for the container. [1]Experimental

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

AttributeTypeDescriptionExamplesRequirement LevelStability
network.interface.namestringThe network interface name.lo; eth0RecommendedExperimental
network.io.directionstringThe network IO operation direction.transmitRecommendedExperimental

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.

ValueDescriptionStability
receivereceiveExperimental
transmittransmitExperimental