version: change prom metric to have separate label with build time
This commit is contained in:
parent
7ad495fe2b
commit
cca1240a65
@ -84,10 +84,11 @@ func RegisterMetric(registry prometheus.Registerer) {
|
||||
Name: "build_info",
|
||||
Help: "Build information",
|
||||
},
|
||||
[]string{"version"},
|
||||
[]string{"version", "build"},
|
||||
)
|
||||
registry.MustRegister(buildInfo)
|
||||
buildInfo.WithLabelValues(Version()).Set(1)
|
||||
info := VersionInfo()
|
||||
buildInfo.WithLabelValues(fmt.Sprintf("%s/%s", info.Version, info.GitRev), info.BuildTime).Set(1)
|
||||
}
|
||||
|
||||
var v string
|
||||
|
Loading…
Reference in New Issue
Block a user