Fix: Label pool.Name on metric was missing

This commit is contained in:
Enrico Stahn 2018-02-22 16:05:49 +11:00
parent a23e9f0c27
commit 510d087da9
No known key found for this signature in database
GPG key ID: 5263621C269A50DE

View file

@ -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
}