summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorajs124 <ajs124@users.noreply.github.com>2022-04-18 22:54:01 +0100
committerGitHub <noreply@github.com>2022-04-18 22:54:01 +0100
commit3fedfb5f8ad1755140ba13382aa1e453fccf6e02 (patch)
tree6d9e56f448111aefd34ddacd72893fd709ecd0ed /nixos/modules
parentbc55a4439daa01a4476ce9f1ac6538e4252eb31f (diff)
parent57e5fe76081be0904a5b62bddaecadb3a911124a (diff)
downloadnixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar.gz
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar.bz2
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar.lz
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar.xz
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.tar.zst
nixpkgs-3fedfb5f8ad1755140ba13382aa1e453fccf6e02.zip
Merge pull request #110870 from asymmetric/doc/prom-node-exp
docs: modules/prometheus: finish exporter setup
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters.xml21
1 files changed, 21 insertions, 0 deletions
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 @@
 <programlisting>
   services.prometheus.exporters.node = {
     enable = true;
+    port = 9100;
     enabledCollectors = [
       "logind"
       "systemd"
@@ -42,6 +43,26 @@
    <link xlink:href="https://nixos.org/nixos/options.html#prometheus.exporters">available
    options</link>.
   </para>
+
+  <para>
+    Prometheus can now be configured to consume the metrics produced by the exporter:
+    <programlisting>
+    services.prometheus = {
+      # ...
+
+      scrapeConfigs = [
+        {
+          job_name = "node";
+          static_configs = [{
+            targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
+          }];
+        }
+      ];
+
+      # ...
+    }
+    </programlisting>
+  </para>
  </section>
  <section xml:id="module-services-prometheus-exporters-new-exporter">
   <title>Adding a new exporter</title>