Skip to content

Commit

Permalink
Added controller id.
Browse files Browse the repository at this point in the history
  • Loading branch information
freddielunchbird committed Feb 24, 2023
1 parent 8dffc1f commit 6bc445a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmon_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const namespace = "cmon"
var (
labels = []string{"ClusterName", "ClusterID", "ControllerId"}
labels2 = []string{"ControllerId"}
labelsCmon = []string{"CmonVersion"}
labelsCmon = []string{"CmonVersion", "ControllerId"}
up = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "up"),
"Was the last CMON query successful.",
Expand Down Expand Up @@ -191,7 +191,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
// _, _ := json.Marshal(res)
// }
ch <- prometheus.MustNewConstMetric(
up, prometheus.GaugeValue, 1, serverVersion)
up, prometheus.GaugeValue, 1, serverVersion, controllerId)
totalCriticalAlarms, totalCount, totalStarted, totalDegraded, totalStopped, totalUnknown, totalFailed, totalBackupFailedAlarms := 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
for _, cluster := range res.Clusters {
// log.Println(cluster.Hosts[0])
Expand Down

0 comments on commit 6bc445a

Please sign in to comment.