From de5e2d2ecbc1ed0cb1267c6c10184e45edc9f642 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Mon, 29 Jul 2019 10:48:44 +0200 Subject: [PATCH] cmd/alertmanager: add alertmanager_cluster_enabled metric (#1973) 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{})