Skip to content

Commit

Permalink
set the labelValues to an array of one element, stage, which I believ…
Browse files Browse the repository at this point in the history
…e is the old way it worked
  • Loading branch information
jforest committed Nov 3, 2016
1 parent af04528 commit 6f693c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nginx_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func NewExporter(uri string) *Exporter {
Help: "Number of errors while scraping nginx.",
}),
processedConnections: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "", "connections_processed_total"),
prometheus.BuildFQName(namespace, "", "connections_processed_total"),
"Number of connections processed by nginx",
[]string{"accepted", "handled", "any"},
nil,
[]string{"stage"},
nil,
),
currentConnections: prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: namespace,
Expand Down Expand Up @@ -116,17 +116,17 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) error {
if err != nil {
return err
}
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "accepted")
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "accepted")
v, err = strconv.Atoi(strings.TrimSpace(parts[1]))
if err != nil {
return err
}
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "handled")
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "handled")
v, err = strconv.Atoi(strings.TrimSpace(parts[2]))
if err != nil {
return err
}
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "any")
ch <- prometheus.MustNewConstMetric(e.processedConnections, prometheus.CounterValue, float64(v), "any")

// current connections
parts = strings.Fields(lines[3])
Expand Down

0 comments on commit 6f693c0

Please sign in to comment.