mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
diskdrive: fix not exposing state "Pred Fail" (#2101)
This commit is contained in:
@@ -38,7 +38,9 @@ var ConfigDefaults = Config{}
|
||||
|
||||
// A Collector is a Prometheus Collector for a few WMI metrics in Win32_DiskDrive.
|
||||
type Collector struct {
|
||||
config Config
|
||||
config Config
|
||||
logger *slog.Logger
|
||||
|
||||
miSession *mi.Session
|
||||
miQuery mi.Query
|
||||
|
||||
@@ -73,7 +75,9 @@ func (c *Collector) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
|
||||
func (c *Collector) Build(logger *slog.Logger, miSession *mi.Session) error {
|
||||
c.logger = logger.With(slog.String("collector", Name))
|
||||
|
||||
c.diskInfo = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(types.Namespace, Name, "info"),
|
||||
"General drive information",
|
||||
@@ -148,7 +152,7 @@ var (
|
||||
"Error",
|
||||
"Degraded",
|
||||
"Unknown",
|
||||
"Pred fail",
|
||||
"Pred Fail",
|
||||
"Starting",
|
||||
"Stopping",
|
||||
"Service",
|
||||
|
||||
Reference in New Issue
Block a user