summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/prometheus/exporters.xml
diff options
context:
space:
mode:
authorWilliButz <wbutz@cyberfnord.de>2019-07-17 14:33:40 +0200
committerWilliButz <wbutz@cyberfnord.de>2019-07-22 16:41:10 +0200
commitfb6f0a48bbe439e9fd34e365308f36e2cd395026 (patch)
tree9f18810fda767419037b02ce6a52b6aacfc08aa7 /nixos/modules/services/monitoring/prometheus/exporters.xml
parent77ccb1fe6ac002564c848e8c48271f4cafd661a6 (diff)
downloadnixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar.gz
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar.bz2
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar.lz
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar.xz
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.tar.zst
nixpkgs-fb6f0a48bbe439e9fd34e365308f36e2cd395026.zip
nixos/prometheus-exporters: add option renaming for submodules
Adds the functionality to create option renamings and removals
for exporter submodules as in nixos/modules/rename.nix.
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/exporters.xml')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters.xml40
1 files changed, 39 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters.xml b/nixos/modules/services/monitoring/prometheus/exporters.xml
index 81ac998729b..616f29e8dd0 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters.xml
+++ b/nixos/modules/services/monitoring/prometheus/exporters.xml
@@ -113,7 +113,7 @@
      specific options and configuration:
 <programlisting>
 # nixpgs/nixos/modules/services/prometheus/exporters/postfix.nix
-{ config, lib, pkgs }:
+{ config, lib, pkgs, options }:
 
 with lib;
 
@@ -184,4 +184,42 @@ in
    </listitem>
   </itemizedlist>
  </section>
+ <section xml:id="module-services-prometheus-exporters-update-exporter-module">
+  <title>Updating an exporter module</title>
+   <para>
+     Should an exporter option change at some point, it is possible to add
+     information about the change to the exporter definition similar to
+     <literal>nixpkgs/nixos/modules/rename.nix</literal>:
+<programlisting>
+{ config, lib, pkgs, options }:
+
+with lib;
+
+let
+  cfg = config.services.prometheus.exporters.nginx;
+in
+{
+  port = 9113;
+  extraOpts = {
+    # additional module options
+    # ...
+  };
+  serviceOpts = {
+    # service configuration
+    # ...
+  };
+  imports = [
+    # 'services.prometheus.exporters.nginx.telemetryEndpoint' -> 'services.prometheus.exporters.nginx.telemetryPath'
+    (mkRenamedOptionModule [ "telemetryEndpoint" ] [ "telemetryPath" ])
+
+    # removed option 'services.prometheus.exporters.nginx.insecure'
+    (mkRemovedOptionModule [ "insecure" ] ''
+      This option was replaced by 'prometheus.exporters.nginx.sslVerify' which defaults to true.
+    '')
+    ({ options.warnings = options.warnings; })
+  ];
+}
+</programlisting>
+    </para>
+  </section>
 </chapter>