summary refs log tree commit diff
diff options
context:
space:
mode:
authorLorenzo Manacorda <lorenzo@mailbox.org>2021-01-26 20:06:50 +0200
committerLorenzo Manacorda <lorenzo@mailbox.org>2021-01-26 20:14:12 +0200
commit57e5fe76081be0904a5b62bddaecadb3a911124a (patch)
tree85d3becae8a16f6436dd974d2b06aa7b39c1305b
parente61999b3f24da7dad685099981226e4d647bd0f6 (diff)
downloadnixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar.gz
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar.bz2
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar.lz
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar.xz
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.tar.zst
nixpkgs-57e5fe76081be0904a5b62bddaecadb3a911124a.zip
docs: modules/prometheus: finish exporter setup
The last step, in which the exporter is hooked up to the server, was missing.
-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>