From 510d087da9a3892044f6a6cd9fc08f3ee8c9b02f Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Thu, 22 Feb 2018 16:05:49 +1100 Subject: [PATCH] Fix: Label pool.Name on metric was missing --- phpfpm/exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpfpm/exporter.go b/phpfpm/exporter.go index 598b185..86343a0 100644 --- a/phpfpm/exporter.go +++ b/phpfpm/exporter.go @@ -135,10 +135,10 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) { e.PoolManager.Update() for _, pool := range e.PoolManager.Pools { - ch <- prometheus.MustNewConstMetric(e.scrapeFailues, prometheus.CounterValue, float64(pool.ScrapeFailures)) + ch <- prometheus.MustNewConstMetric(e.scrapeFailues, prometheus.CounterValue, float64(pool.ScrapeFailures), pool.Name) if pool.ScrapeError != nil { - ch <- prometheus.MustNewConstMetric(e.up, prometheus.GaugeValue, 0) + ch <- prometheus.MustNewConstMetric(e.up, prometheus.GaugeValue, 0, pool.Name) log.Error("Error scraping PHP-FPM: %v", pool.ScrapeError) continue }