Skip to content

Commit

Permalink
Merge pull request #4 from treydock/fix-labels
Browse files Browse the repository at this point in the history
Avoid duplicate label errors
  • Loading branch information
treydock authored Feb 17, 2020
2 parents 745b93e + 37fb0bd commit 48690be
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions collectors/mmces.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ func (c *MmcesCollector) collect(ch chan<- prometheus.Metric) error {
nodename := *configNodeName
mmces_state_out, err := mmces_state_show(nodename)
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mmces")
return err
}
metrics, err := mmces_state_show_parse(mmces_state_out)
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mmces")
return err
}
for _, m := range metrics {
Expand Down
2 changes: 0 additions & 2 deletions collectors/mmhealth.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ func (c *MmhealthCollector) collect(ch chan<- prometheus.Metric) error {
collectTime := time.Now()
mmhealth_out, err := mmhealth()
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mmhealth")
return err
}
metrics, err := mmhealth_parse(mmhealth_out)
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mmhealth")
return err
}
for _, m := range metrics {
Expand Down
1 change: 0 additions & 1 deletion collectors/mmpmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func (c *MmpmonCollector) collect(ch chan<- prometheus.Metric) error {
collectTime := time.Now()
mmpmon_out, err := mmpmon()
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mmpmon")
return err
}
perfs, err := mmpmon_parse(mmpmon_out)
Expand Down
6 changes: 2 additions & 4 deletions collectors/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ func (c *MountCollector) collect(ch chan<- prometheus.Metric) error {
collectTime := time.Now()
gpfsMounts, err := getGPFSMounts()
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mount")
return nil
return err
}
gpfsMountsFstab, err := getGPFSMountsFSTab()
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "mount")
return nil
return err
}
for _, m := range gpfsMountsFstab {
if !SliceContains(gpfsMounts, m) {
Expand Down
2 changes: 0 additions & 2 deletions collectors/verbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ func (c *VerbsCollector) collect(ch chan<- prometheus.Metric) error {
collectTime := time.Now()
out, err := verbs()
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "verbs")
return err
}
metric, err := verbs_parse(out)
if err != nil {
ch <- prometheus.MustNewConstMetric(collectError, prometheus.GaugeValue, 1, "verbs")
return err
}
if metric.Status == "started" {
Expand Down

0 comments on commit 48690be

Please sign in to comment.