version: Prefix build_info metric name
This commit is contained in:
parent
7550d1597c
commit
5c067e3752
@ -90,10 +90,15 @@ func VersionCmd(name string) *cobra.Command {
|
|||||||
return versionCmd
|
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(
|
buildInfo := prometheus.NewGaugeVec(
|
||||||
prometheus.GaugeOpts{
|
prometheus.GaugeOpts{
|
||||||
Name: "build_info",
|
Name: name,
|
||||||
Help: "Build information",
|
Help: "Build information",
|
||||||
},
|
},
|
||||||
[]string{
|
[]string{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user