Skip to content

Commit

Permalink
cmd/alertmanager: add alertmanager_cluster_enabled metric
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
  • Loading branch information
simonpasquier committed Jul 26, 2019
1 parent a74758e commit e9e5fc6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/alertmanager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

Expand Down Expand Up @@ -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{})
Expand Down

0 comments on commit e9e5fc6

Please sign in to comment.