mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-27 07:06:35 +00:00
*: avoid using default wmi client. (#1590)
This commit is contained in:
@@ -3,24 +3,11 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||
)
|
||||
|
||||
// ExpandEnabledChildCollectors used by more complex Collectors where user input specifies enabled child Collectors.
|
||||
// Splits provided child Collectors and deduplicate.
|
||||
func ExpandEnabledChildCollectors(enabled string) []string {
|
||||
result := slices.Compact(strings.Split(enabled, ","))
|
||||
|
||||
// Result must order, to prevent test failures.
|
||||
sort.Strings(result)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func ExpandEnabledCollectors(enabled string) []string {
|
||||
expanded := strings.ReplaceAll(enabled, types.DefaultCollectorsPlaceholder, types.DefaultCollectors)
|
||||
separated := strings.Split(expanded, ",")
|
||||
|
||||
Reference in New Issue
Block a user