Change:
/kind feature This is the once-per-release cut of a new cAdvisor release, which corresponds to the next kubernetes release. cAdvisor v0.29 corresponds to kubernetes v1.10. /sig node /priority important-soon
self-reminder to add per-cpu stats to ignore metrics when vendoring. reminder to add a release notice that one of the container labels fields is being removed.
/kind bug turns out most of the changes are bug-fixes
please mark this issue as approved-for-milestone, since it certainly seems to be, and it's now code slush. Thanks!

Discussion:
}, { "ImportPath": "github.com/google/cadvisor/accelerators", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/api", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/cache/memory", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/client/v2", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/collector", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/common", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/containerd", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/crio", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/docker", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/libcontainer", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/raw", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/rkt", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/container/systemd", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/devicemapper", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/events", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/fs", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/healthz", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/http", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/http/mux", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/info/v1", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/info/v2", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/machine", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/manager", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/manager/watcher", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/manager/watcher/raw", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/manager/watcher/rkt", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/metrics", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/pages", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/pages/static", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/storage", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/summary", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/cloudinfo", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/cpuload", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/cpuload/netlink", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/docker", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/oomparser", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/sysfs", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/utils/sysinfo", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/validate", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/version", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/cadvisor/zfs", <del> "Comment": "v0.28.3-20-g6116f265", "Rev": "6116f265302357cbb10f84737af30b1f13ce2d6c" </del> <ins> "Comment": "v0.29.0", "Rev": "aaaa65dba02880718d0237cd4e80ab8eb278bb19" </ins> }, { "ImportPath": "github.com/google/certificate-transparency/go",

func New(address string, port uint, imageFsInfoProvider ImageFsInfoProvider, rootPath string, usingLegacyStats bool) (Interface, error) { sysFs := sysfs.NewRealSysFs() <del> ignoreMetrics := cadvisormetrics.MetricSet{cadvisormetrics.NetworkTcpUsageMetrics: struct{}{}, cadvisormetrics.NetworkUdpUsageMetrics: struct{}{}} </del> <ins> ignoreMetrics := cadvisormetrics.MetricSet{ cadvisormetrics.NetworkTcpUsageMetrics: struct{}{}, cadvisormetrics.NetworkUdpUsageMetrics: struct{}{}, cadvisormetrics.PerCpuUsageMetrics:     struct{}{}, } </ins> if !usingLegacyStats { ignoreMetrics[cadvisormetrics.DiskUsageMetrics] = struct{}{} }

const ( CpuUsageMetrics        MetricKind = "cpu" <ins> PerCpuUsageMetrics     MetricKind = "percpu" </ins> MemoryUsageMetrics     MetricKind = "memory" CpuLoadMetrics         MetricKind = "cpuLoad" DiskIOMetrics          MetricKind = "diskIO"

libcontainerStats := &libcontainer.Stats{ CgroupStats: cgroupStats, } <del> stats := newContainerStats(libcontainerStats) </del> <ins> withPerCPU := !ignoreMetrics.Has(container.PerCpuUsageMetrics) stats := newContainerStats(libcontainerStats, withPerCPU) </ins> // If we know the pid then get network stats from /proc/<pid>/net/dev if pid == 0 {

var numCpusFunc = getNumberOnlineCPUs // Convert libcontainer stats to info.ContainerStats. <del> func setCpuStats(s *cgroups.Stats, ret *info.ContainerStats) { </del> <ins> func setCpuStats(s *cgroups.Stats, ret *info.ContainerStats, withPerCPU bool) { </ins> ret.Cpu.Usage.User = s.CpuStats.CpuUsage.UsageInUsermode ret.Cpu.Usage.System = s.CpuStats.CpuUsage.UsageInKernelmode <del> ret.Cpu.Usage.Total = 0 </del> <ins> ret.Cpu.Usage.Total = s.CpuStats.CpuUsage.TotalUsage </ins> ret.Cpu.CFS.Periods = s.CpuStats.ThrottlingData.Periods ret.Cpu.CFS.ThrottledPeriods = s.CpuStats.ThrottlingData.ThrottledPeriods ret.Cpu.CFS.ThrottledTime = s.CpuStats.ThrottlingData.ThrottledTime <ins> if !withPerCPU { return } </ins> if len(s.CpuStats.CpuUsage.PercpuUsage) == 0 { // libcontainer's 'GetStats' can leave 'PercpuUsage' nil if it skipped the // cpuacct subsystem.

for i := uint32(0); i < numActual; i++ { ret.Cpu.Usage.PerCpu[i] = s.CpuStats.CpuUsage.PercpuUsage[i] <del> ret.Cpu.Usage.Total += s.CpuStats.CpuUsage.PercpuUsage[i] </del> } }

} } <del> func newContainerStats(libcontainerStats *libcontainer.Stats) *info.ContainerStats { </del> <ins> func newContainerStats(libcontainerStats *libcontainer.Stats, withPerCPU bool) *info.ContainerStats { </ins> ret := &info.ContainerStats{ Timestamp: time.Now(), } if s := libcontainerStats.CgroupStats; s != nil { <del> setCpuStats(s, ret) </del> <ins> setCpuStats(s, ret, withPerCPU) </ins> setDiskIoStats(s, ret) setMemoryStats(s, ret) }

}, }, { name:        "container_cpu_usage_seconds_total", <del> help:        "Cumulative cpu time consumed per cpu in seconds.", </del> <ins> help:        "Cumulative cpu time consumed in seconds.", </ins> valueType:   prometheus.CounterValue, extraLabels: []string{"cpu"}, getValues: func(s *info.ContainerStats) metricValues { <ins> if len(s.Cpu.Usage.PerCpu) == 0 { if s.Cpu.Usage.Total > 0 { return metricValues{{ value:  float64(s.Cpu.Usage.Total) / float64(time.Second), labels: []string{"total"}, }} } } </ins> values := make(metricValues, 0, len(s.Cpu.Usage.PerCpu)) for i, value := range s.Cpu.Usage.PerCpu { if value > 0 {