Skip to content

Commit

Permalink
fix: mark as up later only
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 31, 2019
1 parent 8dff507 commit 9e7a970
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collector/cluster.go
Expand Up @@ -267,7 +267,6 @@ func (c *clusterCollector) Collect(ch chan<- prometheus.Metric) {
log.With("error", err).Error("failed to scrape cluster")
return
}
ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)

ch <- prometheus.MustNewConstMetric(c.balanced, prometheus.GaugeValue, fromBool(cluster.Balanced))
ch <- prometheus.MustNewConstMetric(c.ftsMemoryQuota, prometheus.GaugeValue, cluster.FtsMemoryQuota*1024*1024)
Expand Down Expand Up @@ -298,5 +297,6 @@ func (c *clusterCollector) Collect(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(c.storagetotalsHddUsedbydata, prometheus.GaugeValue, cluster.StorageTotals.Hdd.UsedByData)
ch <- prometheus.MustNewConstMetric(c.storagetotalsHddFree, prometheus.GaugeValue, cluster.StorageTotals.Hdd.Free)

ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)
ch <- prometheus.MustNewConstMetric(c.scrapeDuration, prometheus.GaugeValue, time.Since(start).Seconds())
}
2 changes: 1 addition & 1 deletion collector/node.go
Expand Up @@ -178,7 +178,6 @@ func (c *nodesCollector) Collect(ch chan<- prometheus.Metric) {
log.With("error", err).Error("failed to scrape nodes")
return
}
ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)

// nolint: lll
for _, node := range nodes.Nodes {
Expand All @@ -200,6 +199,7 @@ func (c *nodesCollector) Collect(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(c.interestingStatsEpBgFetched, prometheus.GaugeValue, node.InterestingStats.EpBgFetched, node.Hostname)
}

ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)
// nolint: lll
ch <- prometheus.MustNewConstMetric(c.scrapeDuration, prometheus.GaugeValue, time.Since(start).Seconds())
}
2 changes: 1 addition & 1 deletion collector/task.go
Expand Up @@ -136,7 +136,6 @@ func (c *taskCollector) Collect(ch chan<- prometheus.Metric) {
log.With("error", err).Error("failed to scrape tasks")
return
}
ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)

var compactsReported = map[string]bool{}
// nolint: lll
Expand Down Expand Up @@ -178,6 +177,7 @@ func (c *taskCollector) Collect(ch chan<- prometheus.Metric) {
compactsReported[bucket.Name] = true
}

ch <- prometheus.MustNewConstMetric(c.up, prometheus.GaugeValue, 1)
// nolint: lll
ch <- prometheus.MustNewConstMetric(c.scrapeDuration, prometheus.GaugeValue, time.Since(start).Seconds())
}

0 comments on commit 9e7a970

Please sign in to comment.