diff options
author | Tobias Schmidt <ts@soundcloud.com> | 2015-04-15 23:51:09 -0400 |
---|---|---|
committer | Tobias Schmidt <ts@soundcloud.com> | 2015-04-16 00:02:08 -0400 |
commit | 626900fe21ba129548eec0304c1648533ac6a1a9 (patch) | |
tree | 5b73510f7da40bc0da6c39c3b482dd13521d7edf /node_exporter.go | |
parent | a814d7f8da1c4971e3cd6226848520055b2f396e (diff) | |
download | prometheus_node_collector-626900fe21ba129548eec0304c1648533ac6a1a9.tar.bz2 prometheus_node_collector-626900fe21ba129548eec0304c1648533ac6a1a9.tar.xz prometheus_node_collector-626900fe21ba129548eec0304c1648533ac6a1a9.zip |
Log version at startup
Diffstat (limited to 'node_exporter.go')
-rw-r--r-- | node_exporter.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/node_exporter.go b/node_exporter.go index b0dcbc3..19ac81f 100644 --- a/node_exporter.go +++ b/node_exporter.go | |||
@@ -22,6 +22,9 @@ import ( | |||
22 | const subsystem = "exporter" | 22 | const subsystem = "exporter" |
23 | 23 | ||
24 | var ( | 24 | var ( |
25 | // set at build time | ||
26 | Version = "0.0.0.dev" | ||
27 | |||
25 | configFile = flag.String("config.file", "", "Path to config file.") | 28 | configFile = flag.String("config.file", "", "Path to config file.") |
26 | memProfile = flag.String("debug.memprofile-file", "", "Write memory profile to this file upon receipt of SIGUSR1.") | 29 | memProfile = flag.String("debug.memprofile-file", "", "Write memory profile to this file upon receipt of SIGUSR1.") |
27 | listenAddress = flag.String("web.listen-address", ":9100", "Address on which to expose metrics and web interface.") | 30 | listenAddress = flag.String("web.listen-address", ":9100", "Address on which to expose metrics and web interface.") |
@@ -137,6 +140,7 @@ func loadCollectors(file string) (map[string]collector.Collector, error) { | |||
137 | 140 | ||
138 | func main() { | 141 | func main() { |
139 | flag.Parse() | 142 | flag.Parse() |
143 | |||
140 | if *printCollectors { | 144 | if *printCollectors { |
141 | fmt.Printf("Available collectors:\n") | 145 | fmt.Printf("Available collectors:\n") |
142 | for n, _ := range collector.Factories { | 146 | for n, _ := range collector.Factories { |
@@ -182,6 +186,8 @@ func main() { | |||
182 | </body> | 186 | </body> |
183 | </html>`)) | 187 | </html>`)) |
184 | }) | 188 | }) |
189 | |||
190 | glog.Infof("Starting node_exporter v%s at %s", Version, *listenAddress) | ||
185 | err = http.ListenAndServe(*listenAddress, nil) | 191 | err = http.ListenAndServe(*listenAddress, nil) |
186 | if err != nil { | 192 | if err != nil { |
187 | glog.Fatal(err) | 193 | glog.Fatal(err) |