mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-02 19:42:03 +00:00
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 <superq@gmail.com>
This commit is contained in:
parent
0d28327dd2
commit
ef79cbd801
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user