version: Prefix build_info metric name

This commit is contained in:
Ask Bjørn Hansen 2023-07-08 15:56:57 -07:00
parent 7550d1597c
commit 5c067e3752

View File

@ -90,10 +90,15 @@ func VersionCmd(name string) *cobra.Command {
return versionCmd
}
func RegisterMetric(registry prometheus.Registerer) {
func RegisterMetric(name string, registry prometheus.Registerer) {
if len(name) > 0 {
name = name + "_build_info"
} else {
name = "build_info"
}
buildInfo := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "build_info",
Name: name,
Help: "Build information",
},
[]string{