mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-03 09:06:35 +00:00
@@ -36,7 +36,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
|
||||||
|
|
||||||
@@ -71,7 +73,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",
|
||||||
@@ -146,7 +150,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