|
|
@ -48,6 +48,7 @@ type filesystemCollector struct {
|
|
|
|
ignoredFSTypesPattern *regexp.Regexp
|
|
|
|
ignoredFSTypesPattern *regexp.Regexp
|
|
|
|
sizeDesc, freeDesc, availDesc,
|
|
|
|
sizeDesc, freeDesc, availDesc,
|
|
|
|
filesDesc, filesFreeDesc, roDesc *prometheus.Desc
|
|
|
|
filesDesc, filesFreeDesc, roDesc *prometheus.Desc
|
|
|
|
|
|
|
|
devErrors *prometheus.CounterVec
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type filesystemStats struct {
|
|
|
|
type filesystemStats struct {
|
|
|
@ -102,6 +103,11 @@ func NewFilesystemCollector() (Collector, error) {
|
|
|
|
filesystemLabelNames, nil,
|
|
|
|
filesystemLabelNames, nil,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
devErrors := prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
|
|
|
|
Name: prometheus.BuildFQName(Namespace, subsystem, "device_errors_total"),
|
|
|
|
|
|
|
|
Help: "Total number of errors occurred when getting stats for device",
|
|
|
|
|
|
|
|
}, filesystemLabelNames)
|
|
|
|
|
|
|
|
|
|
|
|
return &filesystemCollector{
|
|
|
|
return &filesystemCollector{
|
|
|
|
ignoredMountPointsPattern: mountPointPattern,
|
|
|
|
ignoredMountPointsPattern: mountPointPattern,
|
|
|
|
ignoredFSTypesPattern: filesystemsTypesPattern,
|
|
|
|
ignoredFSTypesPattern: filesystemsTypesPattern,
|
|
|
@ -111,6 +117,7 @@ func NewFilesystemCollector() (Collector, error) {
|
|
|
|
filesDesc: filesDesc,
|
|
|
|
filesDesc: filesDesc,
|
|
|
|
filesFreeDesc: filesFreeDesc,
|
|
|
|
filesFreeDesc: filesFreeDesc,
|
|
|
|
roDesc: roDesc,
|
|
|
|
roDesc: roDesc,
|
|
|
|
|
|
|
|
devErrors: devErrors,
|
|
|
|
}, nil
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -145,5 +152,6 @@ func (c *filesystemCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
|
|
|
s.ro, s.labelValues...,
|
|
|
|
s.ro, s.labelValues...,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
c.devErrors.Collect(ch)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|