diff --git a/metrics/cgroups/v1/memory.go b/metrics/cgroups/v1/memory.go index ff5fe0d62..78f53d965 100644 --- a/metrics/cgroups/v1/memory.go +++ b/metrics/cgroups/v1/memory.go @@ -543,7 +543,7 @@ var memoryMetrics = []*metric{ unit: metrics.Total, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetUsage() == nil { return nil } return []value{ @@ -559,7 +559,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetUsage() == nil { return nil } return []value{ @@ -575,7 +575,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetUsage() == nil { return nil } return []value{ @@ -591,7 +591,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetUsage() == nil { return nil } return []value{ @@ -607,7 +607,7 @@ var memoryMetrics = []*metric{ unit: metrics.Total, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetSwap() == nil { return nil } return []value{ @@ -623,7 +623,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetSwap() == nil { return nil } return []value{ @@ -639,7 +639,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetSwap() == nil { return nil } return []value{ @@ -655,7 +655,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetSwap() == nil { return nil } return []value{ @@ -671,7 +671,7 @@ var memoryMetrics = []*metric{ unit: metrics.Total, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernel() == nil { return nil } return []value{ @@ -687,7 +687,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernel() == nil { return nil } return []value{ @@ -703,7 +703,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernel() == nil { return nil } return []value{ @@ -719,7 +719,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernel() == nil { return nil } return []value{ @@ -735,7 +735,7 @@ var memoryMetrics = []*metric{ unit: metrics.Total, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernelTCP() == nil { return nil } return []value{ @@ -751,7 +751,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernelTCP() == nil { return nil } return []value{ @@ -767,7 +767,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernelTCP() == nil { return nil } return []value{ @@ -783,7 +783,7 @@ var memoryMetrics = []*metric{ unit: metrics.Bytes, vt: prometheus.GaugeValue, getValues: func(stats *v1.Metrics) []value { - if stats.Memory == nil { + if stats.GetMemory().GetKernelTCP() == nil { return nil } return []value{