mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-03 00:56:35 +00:00
system: refactor collector (#1730)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
12
exporter.go
12
exporter.go
@@ -179,6 +179,12 @@ func run() int {
|
||||
|
||||
logger.Debug("Logging has Started")
|
||||
|
||||
if v, ok := os.LookupEnv("WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE"); ok && v == "pdh" || *togglePDH == "pdh" {
|
||||
logger.Info("Using performance data helper from PHD.dll for performance counter collection. This is in experimental state.")
|
||||
|
||||
toggle.PHDEnabled = true
|
||||
}
|
||||
|
||||
if *printCollectors {
|
||||
printCollectorsToStdout()
|
||||
|
||||
@@ -221,12 +227,6 @@ func run() int {
|
||||
|
||||
logger.Info("Enabled collectors: " + strings.Join(enabledCollectorList, ", "))
|
||||
|
||||
if v, ok := os.LookupEnv("WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE"); ok && v == "pdh" || *togglePDH == "pdh" {
|
||||
logger.Info("Using performance data helper from PHD.dll for performance counter collection. This is in experimental state.")
|
||||
|
||||
toggle.PHDEnabled = true
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("GET /health", httphandler.NewHealthHandler())
|
||||
mux.Handle("GET /version", httphandler.NewVersionHandler())
|
||||
|
||||
Reference in New Issue
Block a user