diff --git a/pkg/systemstatsmonitor/disk_collector.go b/pkg/systemstatsmonitor/disk_collector.go index 6e4ba859..7107baa6 100644 --- a/pkg/systemstatsmonitor/disk_collector.go +++ b/pkg/systemstatsmonitor/disk_collector.go @@ -145,7 +145,7 @@ func NewDiskCollectorOrDie(diskConfig *ssmtypes.DiskStatsConfig) *diskCollector "Disk bytes used, in Bytes", "Byte", metrics.LastValue, - []string{deviceNameLabel, stateLabel}) + []string{deviceNameLabel, fstypeLabel, mountOptionLabel, stateLabel}) if err != nil { glog.Fatalf("Error initializing metric for %q: %v", metrics.DiskBytesUsedID, err) } @@ -276,8 +276,10 @@ func (dc *diskCollector) collect() { continue } deviceName := strings.TrimPrefix(partition.Device, "/dev/") - dc.mBytesUsed.Record(map[string]string{deviceNameLabel: deviceName, stateLabel: "free"}, int64(usageStat.Free)) - dc.mBytesUsed.Record(map[string]string{deviceNameLabel: deviceName, stateLabel: "used"}, int64(usageStat.Used)) + fstype := partition.Fstype + opttypes := partition.Opts + dc.mBytesUsed.Record(map[string]string{deviceNameLabel: deviceName, fstypeLabel: fstype, mountOptionLabel: opttypes, stateLabel: "free"}, int64(usageStat.Free)) + dc.mBytesUsed.Record(map[string]string{deviceNameLabel: deviceName, fstypeLabel: fstype, mountOptionLabel: opttypes, stateLabel: "used"}, int64(usageStat.Used)) } } diff --git a/pkg/systemstatsmonitor/labels.go b/pkg/systemstatsmonitor/labels.go index 3b5c1858..a75e39ee 100644 --- a/pkg/systemstatsmonitor/labels.go +++ b/pkg/systemstatsmonitor/labels.go @@ -24,3 +24,9 @@ const directionLabel = "direction" // stateLabel labels the state of disk/memory/cpu usage, e.g.: "free", "used". const stateLabel = "state" + +// fstypeLabel labels the fst type of the disk, e.g.: "ext4", "ext2", "vfat" +const fstypeLabel = "fstype" + +// mountPointLabel labels the mountpoint of the monitored disk device +const mountOptionLabel = "mountoption" \ No newline at end of file