mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-26 06:04:20 -08:00
Sort collector names in startup logs (#857)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
This commit is contained in:
parent
779090db7e
commit
be9d82b66e
|
@ -17,6 +17,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
|
"sort"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
@ -87,7 +88,12 @@ func main() {
|
||||||
log.Fatalf("Couldn't create collector: %s", err)
|
log.Fatalf("Couldn't create collector: %s", err)
|
||||||
}
|
}
|
||||||
log.Infof("Enabled collectors:")
|
log.Infof("Enabled collectors:")
|
||||||
|
collectors := []string{}
|
||||||
for n := range nc.Collectors {
|
for n := range nc.Collectors {
|
||||||
|
collectors = append(collectors, n)
|
||||||
|
}
|
||||||
|
sort.Strings(collectors)
|
||||||
|
for _, n := range collectors {
|
||||||
log.Infof(" - %s", n)
|
log.Infof(" - %s", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue