From ef79cbd80150e2d335847690c1d2c4a654fc318e Mon Sep 17 00:00:00 2001 From: SuperQ Date: Wed, 18 Dec 2024 16:17:21 +0100 Subject: [PATCH] Fix build info metric Use the new version collector to expose the `alertmanager_build_info` metric. This fixes an incorrect deprecation migration done in #3806. Signed-off-by: SuperQ --- cmd/alertmanager/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/alertmanager/main.go b/cmd/alertmanager/main.go index 40f9c83d..30b02447 100644 --- a/cmd/alertmanager/main.go +++ b/cmd/alertmanager/main.go @@ -33,7 +33,7 @@ import ( "github.com/KimMachineGun/automemlimit/memlimit" "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/collectors" + versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/model" "github.com/prometheus/common/promslog" @@ -116,7 +116,7 @@ func init() { prometheus.MustRegister(configuredReceivers) prometheus.MustRegister(configuredIntegrations) prometheus.MustRegister(configuredInhibitionRules) - prometheus.MustRegister(collectors.NewBuildInfoCollector()) + prometheus.MustRegister(versioncollector.NewCollector("alertmanager")) } func instrumentHandler(handlerName string, handler http.HandlerFunc) http.HandlerFunc {