mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Merge pull request #815 from prometheus/fabxc/fix-date
cmd/prometheus: fix version output
This commit is contained in:
commit
b4dfbf89a8
|
@ -21,6 +21,7 @@ import (
|
||||||
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
|
_ "net/http/pprof" // Comment this line to disable pprof endpoint.
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
@ -206,9 +207,10 @@ func reloadConfig(filename string, rls ...Reloadable) bool {
|
||||||
return success
|
return success
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionInfoTmpl = `prometheus, version {{.version}} (branch: {{.branch}}, revision: {{.revision}})
|
var versionInfoTmpl = `
|
||||||
|
prometheus, version {{.version}} (branch: {{.branch}}, revision: {{.revision}})
|
||||||
build user: {{.buildUser}}
|
build user: {{.buildUser}}
|
||||||
build date: {{.builDate}}
|
build date: {{.buildDate}}
|
||||||
go version: {{.goVersion}}
|
go version: {{.goVersion}}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -219,5 +221,5 @@ func printVersion() {
|
||||||
if err := t.ExecuteTemplate(&buf, "version", version.Map); err != nil {
|
if err := t.ExecuteTemplate(&buf, "version", version.Map); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
fmt.Fprint(os.Stdout, buf.String())
|
fmt.Fprintln(os.Stdout, strings.TrimSpace(buf.String()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue