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.
@@ -966,6 +969,14 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
966
969
func main () {
967
970
flag .Parse ()
968
971
972
+ if * showVersion {
973
+ fmt .Printf (
974
+ "postgres_exporter %s (built with %s)\n " ,
975
+ Version , runtime .Version (),
976
+ )
977
+ return
978
+ }
979
+
969
980
if * onlyDumpMaps {
970
981
dumpMaps ()
971
982
return
You can’t perform that action at this time.
0 commit comments