From b133213c7a53f0af8f1492b505d52a2031f865ce Mon Sep 17 00:00:00 2001 From: Matthias Rampke Date: Sun, 28 Jul 2019 10:37:10 +0200 Subject: 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 --- node_exporter.go | 1 + 1 file changed, 1 insertion(+) (limited to 'node_exporter.go') 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) { ErrorLog: log.NewErrorLogger(), ErrorHandling: promhttp.ContinueOnError, MaxRequestsInFlight: h.maxRequests, + Registry: h.exporterMetricsRegistry, }, ) if h.includeExporterMetrics { -- cgit v1.2.3