Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed May 18, 2024
1 parent c42eeba commit 7defe90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cgroup_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
versionCollector "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"
Expand All @@ -49,7 +50,7 @@ func metricsHandler(logger log.Logger) http.HandlerFunc {
}
cgroupCollector := collector.NewCgroupCollector(cgroupV2, paths, logger)
registry.MustRegister(cgroupCollector)
registry.MustRegister(version.NewCollector(fmt.Sprintf("%s_exporter", collector.Namespace)))
registry.MustRegister(versionCollector.NewCollector(fmt.Sprintf("%s_exporter", collector.Namespace)))

gatherers := prometheus.Gatherers{registry}
if !*disableExporterMetrics {
Expand Down
2 changes: 1 addition & 1 deletion collector/cgroupv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func getInfov2(name string, pids []int, metric *CgroupMetric, logger log.Logger)
}
// effective UID
uid := procStat.UIDs[1]
metric.uid = uid
metric.uid = strconv.FormatUint(uid, 10)
user, err := user.LookupId(metric.uid)
if err != nil {
level.Error(logger).Log("msg", "Error looking up slurm uid", "uid", metric.uid, "err", err)
Expand Down

0 comments on commit 7defe90

Please sign in to comment.