From 57e5fe76081be0904a5b62bddaecadb3a911124a Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Tue, 26 Jan 2021 20:06:50 +0200 Subject: docs: modules/prometheus: finish exporter setup The last step, in which the exporter is hooked up to the server, was missing. --- .../services/monitoring/prometheus/exporters.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nixos/modules/services/monitoring/prometheus/exporters.xml b/nixos/modules/services/monitoring/prometheus/exporters.xml index c2d4b05996a..1df88bb61a1 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.xml +++ b/nixos/modules/services/monitoring/prometheus/exporters.xml @@ -19,6 +19,7 @@ services.prometheus.exporters.node = { enable = true; + port = 9100; enabledCollectors = [ "logind" "systemd" @@ -42,6 +43,26 @@ available options. + + + Prometheus can now be configured to consume the metrics produced by the exporter: + + services.prometheus = { + # ... + + scrapeConfigs = [ + { + job_name = "node"; + static_configs = [{ + targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; + }]; + } + ]; + + # ... + } + +
Adding a new exporter -- cgit 1.4.1