aboutsummaryrefslogtreecommitdiff
path: root/node_exporter.go
diff options
context:
space:
mode:
authorMatthias Rampke <mr@soundcloud.com>2019-07-28 10:37:10 +0200
committerBen Kochie <superq@gmail.com>2019-07-28 10:37:10 +0200
commitb133213c7a53f0af8f1492b505d52a2031f865ce (patch)
treecde372e67e28c0954c9f66f94124a5c6a3f078d9 /node_exporter.go
parentd2be72be4a69579c026c6be3eea31a6617ad10b2 (diff)
downloadprometheus_node_collector-b133213c7a53f0af8f1492b505d52a2031f865ce.tar.bz2
prometheus_node_collector-b133213c7a53f0af8f1492b505d52a2031f865ce.tar.xz
prometheus_node_collector-b133213c7a53f0af8f1492b505d52a2031f865ce.zip
Report non-fatal collection errors in the exporter metric. (#1439)
As per prometheus/client_golang#543, pass the Registry for exporter metrics when setting up the /metrics HTTP handler. With this, the `promhttp_metric_handler_errors_total` metric will increment on (possibly non-fatal) collection-time errors, such as duplicate metrics from text files. Signed-off-by: Matthias Rampke <mr@soundcloud.com>
Diffstat (limited to 'node_exporter.go')
-rw-r--r--node_exporter.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/node_exporter.go b/node_exporter.go
index 550d7b1..ceee4e1 100644
--- a/node_exporter.go
+++ b/node_exporter.go
@@ -116,6 +116,7 @@ func (h *handler) innerHandler(filters ...string) (http.Handler, error) {
116 ErrorLog: log.NewErrorLogger(), 116 ErrorLog: log.NewErrorLogger(),
117 ErrorHandling: promhttp.ContinueOnError, 117 ErrorHandling: promhttp.ContinueOnError,
118 MaxRequestsInFlight: h.maxRequests, 118 MaxRequestsInFlight: h.maxRequests,
119 Registry: h.exporterMetricsRegistry,
119 }, 120 },
120 ) 121 )
121 if h.includeExporterMetrics { 122 if h.includeExporterMetrics {