From d1a21a90fa4b8b2d01be5133d543a4a69ec9f6d3 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 5 Dec 2017 18:36:01 -0800 Subject: [PATCH] Restore upstream metrics removed by e40ee9 --- nginx_vts_exporter.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx_vts_exporter.go b/nginx_vts_exporter.go index 8d8e498..62085e9 100644 --- a/nginx_vts_exporter.go +++ b/nginx_vts_exporter.go @@ -281,6 +281,16 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) { ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["response"], prometheus.GaugeValue, float64(s.ResponseMsec), name, s.Server) } + + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, total, name, "total") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, one, name, "1xx") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, two, name, "2xx") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, three, name, "3xx") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, four, name, "4xx") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["requests"], prometheus.CounterValue, five, name, "5xx") + + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["bytes"], prometheus.CounterValue, inbytes, name, "in") + ch <- prometheus.MustNewConstMetric(e.upstreamMetrics["bytes"], prometheus.CounterValue, outbytes, name, "out") } // FilterZones for filter, values := range nginxVtx.FilterZones {