mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-22 20:56:36 +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.
|
// A Collector is a Prometheus Collector for a few WMI metrics in Win32_DiskDrive.
|
||||||
type Collector struct {
|
type Collector struct {
|
||||||
config Config
|
config Config
|
||||||
|
logger *slog.Logger
|
||||||
|
|
||||||
miSession *mi.Session
|
miSession *mi.Session
|
||||||
miQuery mi.Query
|
miQuery mi.Query
|
||||||
|
|
||||||
@@ -73,7 +75,9 @@ func (c *Collector) Close() error {
|
|||||||
return nil
|
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(
|
c.diskInfo = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "info"),
|
prometheus.BuildFQName(types.Namespace, Name, "info"),
|
||||||
"General drive information",
|
"General drive information",
|
||||||
@@ -148,7 +152,7 @@ var (
|
|||||||
"Error",
|
"Error",
|
||||||
"Degraded",
|
"Degraded",
|
||||||
"Unknown",
|
"Unknown",
|
||||||
"Pred fail",
|
"Pred Fail",
|
||||||
"Starting",
|
"Starting",
|
||||||
"Stopping",
|
"Stopping",
|
||||||
"Service",
|
"Service",
|
||||||
|
|||||||
Reference in New Issue
Block a user