aboutsummaryrefslogtreecommitdiff
path: root/node_exporter.go
diff options
context:
space:
mode:
authorBrian Brazil <brian.brazil@robustperception.io>2018-03-29 13:42:44 +0100
committerGitHub <noreply@github.com>2018-03-29 13:42:44 +0100
commitbe9d82b66e6c5f9d0e31e3e29ecb3477777687b8 (patch)
tree2744153083709dc3d663272f526606408390744d /node_exporter.go
parent779090db7e78b751deca7270dcbdfb75111bd940 (diff)
downloadprometheus_node_collector-be9d82b66e6c5f9d0e31e3e29ecb3477777687b8.tar.bz2
prometheus_node_collector-be9d82b66e6c5f9d0e31e3e29ecb3477777687b8.tar.xz
prometheus_node_collector-be9d82b66e6c5f9d0e31e3e29ecb3477777687b8.zip
Sort collector names in startup logs (#857)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
Diffstat (limited to 'node_exporter.go')
-rw-r--r--node_exporter.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/node_exporter.go b/node_exporter.go
index b2884c3..79863b9 100644
--- a/node_exporter.go
+++ b/node_exporter.go
@@ -17,6 +17,7 @@ import (
17 "fmt" 17 "fmt"
18 "net/http" 18 "net/http"
19 _ "net/http/pprof" 19 _ "net/http/pprof"
20 "sort"
20 21
21 "github.com/prometheus/client_golang/prometheus" 22 "github.com/prometheus/client_golang/prometheus"
22 "github.com/prometheus/client_golang/prometheus/promhttp" 23 "github.com/prometheus/client_golang/prometheus/promhttp"
@@ -87,7 +88,12 @@ func main() {
87 log.Fatalf("Couldn't create collector: %s", err) 88 log.Fatalf("Couldn't create collector: %s", err)
88 } 89 }
89 log.Infof("Enabled collectors:") 90 log.Infof("Enabled collectors:")
91 collectors := []string{}
90 for n := range nc.Collectors { 92 for n := range nc.Collectors {
93 collectors = append(collectors, n)
94 }
95 sort.Strings(collectors)
96 for _, n := range collectors {
91 log.Infof(" - %s", n) 97 log.Infof(" - %s", n)
92 } 98 }
93 99