@@ -13,8 +13,9 @@ import (
13
13
"syscall"
14
14
"time"
15
15
16
- "github.com/golang/glog"
17
16
"github.com/prometheus/client_golang/prometheus"
17
+ "github.com/prometheus/log"
18
+
18
19
"github.com/prometheus/node_exporter/collector"
19
20
)
20
21
@@ -93,10 +94,10 @@ func Execute(name string, c collector.Collector, ch chan<- prometheus.Metric) {
93
94
var result string
94
95
95
96
if err != nil {
96
- glog .Infof ("ERROR: %s failed after %fs: %s" , name , duration .Seconds (), err )
97
+ log .Infof ("ERROR: %s failed after %fs: %s" , name , duration .Seconds (), err )
97
98
result = "error"
98
99
} else {
99
- glog .Infof ("OK: %s success after %fs." , name , duration .Seconds ())
100
+ log .Infof ("OK: %s success after %fs." , name , duration .Seconds ())
100
101
result = "success"
101
102
}
102
103
scrapeDurations .WithLabelValues (name , result ).Observe (duration .Seconds ())
@@ -135,12 +136,12 @@ func main() {
135
136
}
136
137
collectors , err := loadCollectors ()
137
138
if err != nil {
138
- glog .Fatalf ("Couldn't load collectors: %s" , err )
139
+ log .Fatalf ("Couldn't load collectors: %s" , err )
139
140
}
140
141
141
- glog .Infof ("Enabled collectors:" )
142
+ log .Infof ("Enabled collectors:" )
142
143
for n , _ := range collectors {
143
- glog .Infof (" - %s" , n )
144
+ log .Infof (" - %s" , n )
144
145
}
145
146
146
147
nodeCollector := NodeCollector {collectors : collectors }
@@ -152,7 +153,7 @@ func main() {
152
153
handler := prometheus .Handler ()
153
154
if * authUser != "" || * authPass != "" {
154
155
if * authUser == "" || * authPass == "" {
155
- glog .Fatal ("You need to specify -auth.user and -auth.pass to enable basic auth" )
156
+ log .Fatal ("You need to specify -auth.user and -auth.pass to enable basic auth" )
156
157
}
157
158
handler = & basicAuthHandler {
158
159
handler : prometheus .Handler ().ServeHTTP ,
@@ -172,9 +173,9 @@ func main() {
172
173
</html>` ))
173
174
})
174
175
175
- glog .Infof ("Starting node_exporter v%s at %s" , Version , * listenAddress )
176
+ log .Infof ("Starting node_exporter v%s at %s" , Version , * listenAddress )
176
177
err = http .ListenAndServe (* listenAddress , nil )
177
178
if err != nil {
178
- glog .Fatal (err )
179
+ log .Fatal (err )
179
180
}
180
181
}
0 commit comments