From 75946db927acac291034ed350f04f36b4715e2bc Mon Sep 17 00:00:00 2001 From: Alexey Lesovsky Date: Tue, 6 Apr 2021 17:41:54 +0500 Subject: [PATCH] Reduce messages severity from error to warning. Occurred events don't interrupt collecting metrics, hence could be considered as warnings. --- internal/collector/filesystem_common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/collector/filesystem_common.go b/internal/collector/filesystem_common.go index 6f1a43d..88491db 100644 --- a/internal/collector/filesystem_common.go +++ b/internal/collector/filesystem_common.go @@ -60,7 +60,7 @@ func parseProcMounts(r io.Reader, filters map[string]filter.Filter) ([]mount, er // truncateDeviceName truncates passed full path to device to short device name. func truncateDeviceName(path string) string { if path == "" { - log.Warnf("empty path passed") + log.Warnf("cannot truncate empty device path") return "" } // Make name which will be returned in case of later errors occurred. @@ -70,7 +70,7 @@ func truncateDeviceName(path string) string { // Check device path exists. fi, err := os.Lstat(path) if err != nil { - log.Errorf("stat device path %s failed: %s, use defaults (%s)", path, err, name) + log.Warnf("%s, use default '%s'", err, name) return name } @@ -78,7 +78,7 @@ func truncateDeviceName(path string) string { if fi.Mode()&os.ModeSymlink != 0 { resolved, err := os.Readlink(path) if err != nil { - log.Errorf("dereference device path %s failed: %s, use name's last part (%s)", path, err, name) + log.Warnf("%s, use name's last part '%s'", err, name) return name } // Swap name to dereferenced origin.