From e9e5fc69d35b39e93871eac263861d65d4fcf98c Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Thu, 25 Jul 2019 17:15:35 +0200 Subject: [PATCH] cmd/alertmanager: add alertmanager_cluster_enabled metric Signed-off-by: Simon Pasquier --- cmd/alertmanager/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/alertmanager/main.go b/cmd/alertmanager/main.go index 74075a287c..a84f36d586 100644 --- a/cmd/alertmanager/main.go +++ b/cmd/alertmanager/main.go @@ -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{})