Make filesystem collector more robust.

Current behaviour throws away all stats on any Statfs error. In practice
this is not useful. This turns such errors into debug log messages -
though silently ignoring them seems even more valid to me.
This commit is contained in:
Kevin Lyda 2015-10-18 19:47:45 +01:00
parent eee6298266
commit 36291d456e
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,6 @@ package collector
import (
"bufio"
"fmt"
"os"
"strings"
"syscall"
@ -54,8 +53,9 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
buf := new(syscall.Statfs_t)
err := syscall.Statfs(mpd.mountPoint, buf)
if err != nil {
return nil, fmt.Errorf("Statfs on %s returned %s",
log.Debugf("Statfs on %s returned %s",
mpd.mountPoint, err)
continue
}
labelValues := []string{mpd.device, mpd.mountPoint, mpd.fsType}