diff options
author | Matthias Rampke <mr@soundcloud.com> | 2019-07-28 10:37:10 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-07-28 10:37:10 +0200 |
commit | b133213c7a53f0af8f1492b505d52a2031f865ce (patch) | |
tree | cde372e67e28c0954c9f66f94124a5c6a3f078d9 /collector | |
parent | d2be72be4a69579c026c6be3eea31a6617ad10b2 (diff) | |
download | prometheus_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 'collector')
-rw-r--r-- | collector/fixtures/e2e-64k-page-output.txt | 4 | ||||
-rw-r--r-- | collector/fixtures/e2e-output.txt | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/collector/fixtures/e2e-64k-page-output.txt b/collector/fixtures/e2e-64k-page-output.txt index 8e9ba2c..14bd80d 100644 --- a/collector/fixtures/e2e-64k-page-output.txt +++ b/collector/fixtures/e2e-64k-page-output.txt | |||
@@ -3539,6 +3539,10 @@ node_zfs_zpool_wupdate{zpool="poolz1"} 1.10734831833266e+14 | |||
3539 | # TYPE process_virtual_memory_bytes gauge | 3539 | # TYPE process_virtual_memory_bytes gauge |
3540 | # HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. | 3540 | # HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. |
3541 | # TYPE process_virtual_memory_max_bytes gauge | 3541 | # TYPE process_virtual_memory_max_bytes gauge |
3542 | # HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler. | ||
3543 | # TYPE promhttp_metric_handler_errors_total counter | ||
3544 | promhttp_metric_handler_errors_total{cause="encoding"} 0 | ||
3545 | promhttp_metric_handler_errors_total{cause="gathering"} 0 | ||
3542 | # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. | 3546 | # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. |
3543 | # TYPE promhttp_metric_handler_requests_in_flight gauge | 3547 | # TYPE promhttp_metric_handler_requests_in_flight gauge |
3544 | promhttp_metric_handler_requests_in_flight 1 | 3548 | promhttp_metric_handler_requests_in_flight 1 |
diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index dab7df8..657856e 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt | |||
@@ -3539,6 +3539,10 @@ node_zfs_zpool_wupdate{zpool="poolz1"} 1.10734831833266e+14 | |||
3539 | # TYPE process_virtual_memory_bytes gauge | 3539 | # TYPE process_virtual_memory_bytes gauge |
3540 | # HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. | 3540 | # HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes. |
3541 | # TYPE process_virtual_memory_max_bytes gauge | 3541 | # TYPE process_virtual_memory_max_bytes gauge |
3542 | # HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler. | ||
3543 | # TYPE promhttp_metric_handler_errors_total counter | ||
3544 | promhttp_metric_handler_errors_total{cause="encoding"} 0 | ||
3545 | promhttp_metric_handler_errors_total{cause="gathering"} 0 | ||
3542 | # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. | 3546 | # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. |
3543 | # TYPE promhttp_metric_handler_requests_in_flight gauge | 3547 | # TYPE promhttp_metric_handler_requests_in_flight gauge |
3544 | promhttp_metric_handler_requests_in_flight 1 | 3548 | promhttp_metric_handler_requests_in_flight 1 |