add git commit

This commit is contained in:
Anton Evangelatov 2018-12-04 15:53:25 +01:00
parent fe3da49a2b
commit f7b0db6563

View file

@ -32,6 +32,10 @@ import (
cli "gopkg.in/urfave/cli.v1"
)
var (
gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
)
const (
collectionInterval = 5 * time.Second
)
@ -170,6 +174,7 @@ func setupMetrics(ctx *cli.Context) {
go influxdb.InfluxDBWithTags(gethmetrics.DefaultRegistry, collectionInterval, endpoint, database, username, password, "swarm-smoke.", map[string]string{
"host": hosttag,
"version": gitCommit,
"filesize": fmt.Sprintf("%v", filesize),
})
}