mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-09 23:24:09 -08:00
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>
This commit is contained in:
parent
d2be72be4a
commit
b133213c7a
|
@ -3539,6 +3539,10 @@ node_zfs_zpool_wupdate{zpool="poolz1"} 1.10734831833266e+14
|
|||
# TYPE process_virtual_memory_bytes gauge
|
||||
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
|
||||
# TYPE process_virtual_memory_max_bytes gauge
|
||||
# HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler.
|
||||
# TYPE promhttp_metric_handler_errors_total counter
|
||||
promhttp_metric_handler_errors_total{cause="encoding"} 0
|
||||
promhttp_metric_handler_errors_total{cause="gathering"} 0
|
||||
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
|
||||
# TYPE promhttp_metric_handler_requests_in_flight gauge
|
||||
promhttp_metric_handler_requests_in_flight 1
|
||||
|
|
|
@ -3539,6 +3539,10 @@ node_zfs_zpool_wupdate{zpool="poolz1"} 1.10734831833266e+14
|
|||
# TYPE process_virtual_memory_bytes gauge
|
||||
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
|
||||
# TYPE process_virtual_memory_max_bytes gauge
|
||||
# HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler.
|
||||
# TYPE promhttp_metric_handler_errors_total counter
|
||||
promhttp_metric_handler_errors_total{cause="encoding"} 0
|
||||
promhttp_metric_handler_errors_total{cause="gathering"} 0
|
||||
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
|
||||
# TYPE promhttp_metric_handler_requests_in_flight gauge
|
||||
promhttp_metric_handler_requests_in_flight 1
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue