diff --git a/pkg/systemstatsmonitor/disk_collector.go b/pkg/systemstatsmonitor/disk_collector.go index 3bab1528..66cc30a9 100644 --- a/pkg/systemstatsmonitor/disk_collector.go +++ b/pkg/systemstatsmonitor/disk_collector.go @@ -269,7 +269,16 @@ func (dc *diskCollector) collect() { if dc.mBytesUsed == nil { return } + + // to make sure that the rows are not duplicated + // we display only the only one row even if there are + // mutiple rows for the same disk. + seen := make(map[string]bool) for _, partition := range partitions { + if seen[partition.Device] { + continue + } + seen[partition.Device] = true usageStat, err := disk.Usage(partition.Mountpoint) if err != nil { glog.Errorf("Failed to retrieve disk usage for %q: %v", partition.Mountpoint, err)