feat: add perfcounter.engine CLI option as alternative to WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE env (#1723)

This commit is contained in:
Jan-Otto Kröpke
2024-11-09 23:41:59 +01:00
committed by GitHub
parent b26ae86992
commit e6c9253f15
16 changed files with 64 additions and 62 deletions

View File

@@ -3,7 +3,6 @@
package utils
import (
"os"
"strings"
"github.com/prometheus-community/windows_exporter/internal/types"
@@ -27,19 +26,3 @@ func ExpandEnabledCollectors(enabled string) []string {
return result
}
func PDHEnabled() bool {
if v, ok := os.LookupEnv("WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE"); ok && v == "pdh" {
return true
}
return false
}
func MIEnabled() bool {
if v, ok := os.LookupEnv("WINDOWS_EXPORTER_WMI_ENGINE"); ok && v == "mi" {
return true
}
return false
}