Skip to content

Commit

Permalink
Fix build info metric
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
SuperQ committed Dec 18, 2024
1 parent 0d28327 commit ef79cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/alertmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ef79cbd

Please sign in to comment.