File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
"net/url"
12
12
"os"
13
13
"regexp"
14
+ "runtime"
14
15
"strconv"
15
16
"sync"
16
17
"time"
@@ -23,6 +24,7 @@ import (
23
24
"github.com/prometheus/common/log"
24
25
)
25
26
27
+ // executable version (set at build time by make)
26
28
var Version string = "0.0.1"
27
29
28
30
var db * sql.DB = nil
44
46
"dumpmaps" , false ,
45
47
"Do not run, simply dump the maps." ,
46
48
)
49
+ showVersion = flag .Bool ("version" , false , "print version" )
47
50
)
48
51
49
52
// Metric name parts.
@@ -967,6 +970,14 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
967
970
func main () {
968
971
flag .Parse ()
969
972
973
+ if * showVersion {
974
+ fmt .Printf (
975
+ "postgres_exporter %s (built with %s)\n " ,
976
+ Version , runtime .Version (),
977
+ )
978
+ return
979
+ }
980
+
970
981
if * onlyDumpMaps {
971
982
dumpMaps ()
972
983
return
You can’t perform that action at this time.
0 commit comments