mirror of
https://github.com/prometheus/alertmanager
synced 2025-04-18 13:06:06 +00:00
cmd/alertmanager: add alertmanager_cluster_enabled metric (#1973)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
a74758e4c7
commit
2bbfd4acb6
@ -80,12 +80,19 @@ var (
|
||||
},
|
||||
[]string{"handler", "method"},
|
||||
)
|
||||
clusterEnabled = prometheus.NewGauge(
|
||||
prometheus.GaugeOpts{
|
||||
Name: "alertmanager_cluster_enabled",
|
||||
Help: "Indicates whether the clustering is enabled or not.",
|
||||
},
|
||||
)
|
||||
promlogConfig = promlog.Config{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(requestDuration)
|
||||
prometheus.MustRegister(responseSize)
|
||||
prometheus.MustRegister(clusterEnabled)
|
||||
prometheus.MustRegister(version.NewCollector("alertmanager"))
|
||||
}
|
||||
|
||||
@ -223,6 +230,7 @@ func run() int {
|
||||
level.Error(logger).Log("msg", "unable to initialize gossip mesh", "err", err)
|
||||
return 1
|
||||
}
|
||||
clusterEnabled.Set(1)
|
||||
}
|
||||
|
||||
stopc := make(chan struct{})
|
||||
|
Loading…
Reference in New Issue
Block a user