Skip to content

Commit 3187002

Browse files
authored
chore: remove x/exp usage (#1615)
1 parent bd21919 commit 3187002

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/collector/perfdata/perfdata.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package perfdata
55
import (
66
"encoding/json"
77
"fmt"
8+
"maps"
9+
"slices"
810
"strings"
911

1012
"github.com/alecthomas/kingpin/v2"
@@ -14,7 +16,6 @@ import (
1416
"github.com/prometheus-community/windows_exporter/pkg/types"
1517
"github.com/prometheus/client_golang/prometheus"
1618
"github.com/yusufpapurcu/wmi"
17-
"golang.org/x/exp/maps"
1819
)
1920

2021
const (
@@ -97,7 +98,7 @@ func (c *Collector) Build(logger log.Logger, _ *wmi.Client) error {
9798
_ = level.Warn(logger).Log("msg", "The perfdata collector is in an experimental state! The configuration may change in future. Please report any issues.")
9899

99100
for i, object := range c.config.Objects {
100-
collector, err := perfdata.NewCollector(object.Object, object.Instances, maps.Keys(object.Counters))
101+
collector, err := perfdata.NewCollector(object.Object, object.Instances, slices.Sorted(maps.Keys(object.Counters)))
101102
if err != nil {
102103
return fmt.Errorf("failed to create pdh collector: %w", err)
103104
}

0 commit comments

Comments
 (0)