version: fix metric name for services with dash in the name

This commit is contained in:
Ask Bjørn Hansen 2024-02-03 00:21:31 -08:00
parent 5aeaa97c6f
commit 1e8785bd32
1 changed files with 1 additions and 0 deletions

View File

@ -92,6 +92,7 @@ func VersionCmd(name string) *cobra.Command {
func RegisterMetric(name string, registry prometheus.Registerer) {
if len(name) > 0 {
name = strings.ReplaceAll(name, "-", "_")
name = name + "_build_info"
} else {
name = "build_info"