|
|
@ -18,10 +18,10 @@ package collector |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"github.com/go-kit/log/level" |
|
|
|
|
|
|
|
"golang.org/x/sys/unix" |
|
|
|
|
|
|
|
"syscall" |
|
|
|
"syscall" |
|
|
|
"unsafe" |
|
|
|
"unsafe" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"golang.org/x/sys/unix" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
@ -98,14 +98,14 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { |
|
|
|
for _, v := range mnt { |
|
|
|
for _, v := range mnt { |
|
|
|
mountpoint := unix.ByteSliceToString(v.F_mntonname[:]) |
|
|
|
mountpoint := unix.ByteSliceToString(v.F_mntonname[:]) |
|
|
|
if c.excludedMountPointsPattern.MatchString(mountpoint) { |
|
|
|
if c.excludedMountPointsPattern.MatchString(mountpoint) { |
|
|
|
level.Debug(c.logger).Log("msg", "Ignoring mount point", "mountpoint", mountpoint) |
|
|
|
c.logger.Debug("msg", "Ignoring mount point", "mountpoint", mountpoint) |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
device := unix.ByteSliceToString(v.F_mntfromname[:]) |
|
|
|
device := unix.ByteSliceToString(v.F_mntfromname[:]) |
|
|
|
fstype := unix.ByteSliceToString(v.F_fstypename[:]) |
|
|
|
fstype := unix.ByteSliceToString(v.F_fstypename[:]) |
|
|
|
if c.excludedFSTypesPattern.MatchString(fstype) { |
|
|
|
if c.excludedFSTypesPattern.MatchString(fstype) { |
|
|
|
level.Debug(c.logger).Log("msg", "Ignoring fs type", "type", fstype) |
|
|
|
c.logger.Debug("msg", "Ignoring fs type", "type", fstype) |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|