Containers

Note: Sysdig follows the Prometheus-compabtible naming convention for both metrics and labels as opposed to the previous statsd-compatible, legacy Sysdig naming convention. However, this page still shows metrics in the legacy Sysdig naming convention. Until this page is updated, see Metrics and Label Mapping for the mapping between Sysdig legacy and Prometheus naming conventions.

This topic introduces you to the Container metrics.

container.count

The number of containers in the infrastructure.

MetadataDescription
Metric TypeGauge
Value TypeInteger
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationRate
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

container.id

The container’s identifier.

For Docker containers, this value is a 12 digit hex number.

MetadataDescription
Metric TypeGauge
Value TypeString
Segment ByContainer
Default Time AggregationN/A
Available Time Aggregation FormatsN/A
Default Group AggregationN/A
Available Time Aggregation FormatsN/A

container.image

The name of the image used to run the container.

MetadataDescription
Metric TypeGauge
Value TypeString
Segment ByContainer
Default Time AggregationN/A
Available Time Aggregation FormatsN/A
Default Group AggregationN/A
Available Time Aggregation FormatsN/A

container.name

The name of the container.

MetadataDescription
Metric TypeGauge
Value TypeString
Segment ByContainer
Default Time AggregationN/A
Available Time Aggregation FormatsN/A
Default Group AggregationN/A
Available Time Aggregation FormatsN/A

container.type

The type of container (for example, Docker, LXC, or Mesos).

MetadataDescription
Metric TypeGauge
Value TypeString
Segment ByContainer
Default Time AggregationN/A
Available Time Aggregation FormatsN/A
Default Group AggregationN/A
Available Time Aggregation FormatsN/A

cpu.quota.used.percent

The percentage of CPU quota a container actually used over a defined period of time.

CPU quotas are a common way of creating a CPU limit for a container. A container can only spend its quota of time on CPU cycles across a given time period. The default time period is 100ms.

Unlike CPU shares, CPU quota is a hard limit for the amount of CPU the container can use. For this reason, the CPU quota should not exceed 100% for an extended period of time. For a shorter time, containers are allowed to consume higher than the CPU quota.

MetadataDescription
Metric TypeGauge
Value Type%
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationAverage
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

cpu.shares.count

The amount of CPU shares assigned to the container’s cgroup. CPU shares represent a relative weight used by the kernel to distribute CPU cycles across different containers. Each container receives its own allocation of CPU cycles, based on the ratio of share allocation for the container versus the total share allocation for all containers. For example, if an environment has three containers, each with 1024 shares, then each will receive 1/3 of the CPU cycles.

The default value for a container is 1024.

Defining a CPU shares count is a common way to create a CPU limit for a container.

The CPU shares count is not a hard limit. A container can consume more than its allocation, as long as the CPU has cycles that are not being consumed by the container they were originally allocated to.

MetadataDescription
Metric TypeGauge
Value TypeInteger
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationRate
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

cpu.shares.used.percent

The percentage of a container’s allocated CPU shares that are used. CPU shares are a common way of creating a CPU limit for a container, as they represent a relative weight used by the kernel to distribute CPU cycles across different containers. Each container receives its own allocation of CPU cycles, according to the ratio of share count vs the total number of shares claimed by all containers. For example, in an infrastructure with three containers, each with 1024 shares, each container receives 1/3 of the CPU cycles.

A container can use more CPU cycles than allocated if the CPU has cycles that are not being consumed by the container they were originally allocated to. This means that the value of cpu.shares.used.percent can exceed 100%.

MetadataDescription
Metric TypeGauge
Value Type%
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationAverage
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

memory.limit.bytes

The RAM limit assigned to a container. The default value is 0.

MetadataDescription
Metric TypeGauge
Value TypeByte
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationRate
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

memory.limit.used.percent

The percentage of the memory limit used by a container.

MetadataDescription
Metric TypeGauge
Value Type%
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationAverage
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

swap.limit.bytes

The swap limit assigned to a container.

MetadataDescription
Metric TypeGauge
Value TypeByte
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationRate
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max

swap.limit.used.percent

The percentage of swap limit used by the container.

MetadataDescription
Metric TypeGauge
Value Type%
Segment ByHost, Container, Process, Kubernetes, Mesos, Swarm, CloudProvider
Default Time AggregationAverage
Available Time Aggregation FormatsAvg, Rate, Sum, Min, Max
Default Group AggregationAverage
Available Time Aggregation FormatsAvg, Sum, Min, Max