Skip to content

Commit ef5efb7

Browse files
authored
Fix mount points being collected multiple times in filesystem_linux (#3376)
Signed-off-by: Markus Sütter <[email protected]>
1 parent ead70c7 commit ef5efb7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

collector/filesystem_linux.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ func (c *filesystemCollector) processStat(labels filesystemLabels) filesystemSta
128128
}
129129
stuckMountsMtx.Unlock()
130130

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

0 commit comments

Comments
 (0)