diff options
Diffstat (limited to 'collector/supervisord.go')
-rw-r--r-- | collector/supervisord.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/collector/supervisord.go b/collector/supervisord.go index 2a7aedc..20fa36f 100644 --- a/collector/supervisord.go +++ b/collector/supervisord.go | |||
@@ -116,17 +116,17 @@ func (c *supervisordCollector) Update(ch chan<- prometheus.Metric) error { | |||
116 | return err | 116 | return err |
117 | } | 117 | } |
118 | for _, info := range infos { | 118 | for _, info := range infos { |
119 | lables := []string{info.Name, info.Group} | 119 | labels := []string{info.Name, info.Group} |
120 | 120 | ||
121 | ch <- prometheus.MustNewConstMetric(c.stateDesc, prometheus.GaugeValue, float64(info.State), lables...) | 121 | ch <- prometheus.MustNewConstMetric(c.stateDesc, prometheus.GaugeValue, float64(info.State), labels...) |
122 | ch <- prometheus.MustNewConstMetric(c.exitStatusDesc, prometheus.GaugeValue, float64(info.ExitStatus), lables...) | 122 | ch <- prometheus.MustNewConstMetric(c.exitStatusDesc, prometheus.GaugeValue, float64(info.ExitStatus), labels...) |
123 | 123 | ||
124 | if c.isRunning(info.State) { | 124 | if c.isRunning(info.State) { |
125 | ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 1, lables...) | 125 | ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 1, labels...) |
126 | ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, float64(info.Now-info.Start), lables...) | 126 | ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, float64(info.Now-info.Start), labels...) |
127 | } else { | 127 | } else { |
128 | ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 0, lables...) | 128 | ch <- prometheus.MustNewConstMetric(c.upDesc, prometheus.GaugeValue, 0, labels...) |
129 | ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, 0, lables...) | 129 | ch <- prometheus.MustNewConstMetric(c.uptimeDesc, prometheus.CounterValue, 0, labels...) |
130 | } | 130 | } |
131 | log.Debugf("%s:%s is %s on pid %d", info.Group, info.Name, info.StateName, info.PID) | 131 | log.Debugf("%s:%s is %s on pid %d", info.Group, info.Name, info.StateName, info.PID) |
132 | } | 132 | } |