Skip to content

Commit 83efcfe

Browse files
committed
Fix mount points being collected multiple times in filesystem_linux
Signed-off-by: Markus Sütter <[email protected]>
1 parent b57f5ba commit 83efcfe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

collector/filesystem_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ func (c *filesystemCollector) processStat(labels filesystemLabels) filesystemSta
132132
}
133133
stuckMountsMtx.Unlock()
134134

135+
// Remove options from labels because options will not be used from this point forward
136+
// and keeping them can lead to errors when the same device is mounted to the same mountpoint
137+
// twice, with different options (metrics would be recorded multiple times).
138+
labels.options = ""
139+
135140
if err != nil {
136141
labels.deviceError = err.Error()
137142
c.logger.Debug("Error on statfs() system call", "rootfs", rootfsFilePath(labels.mountPoint), "err", err)

0 commit comments

Comments
 (0)