From b0ccd6dd16909c8639c2d9bee7dd2a2a0ac74c30 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 19 Sep 2019 19:17:30 +0200 Subject: Revert "nixos/doc: re-format" This reverts commit ea6e8775bd69e4676c623a85c39f1da540d29ad1. The new format is not an improvement. --- .../services/monitoring/prometheus/exporters.xml | 51 +++++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) (limited to 'nixos/modules/services/monitoring/prometheus/exporters.xml') diff --git a/nixos/modules/services/monitoring/prometheus/exporters.xml b/nixos/modules/services/monitoring/prometheus/exporters.xml index 814e7365584..c2d4b05996a 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.xml +++ b/nixos/modules/services/monitoring/prometheus/exporters.xml @@ -5,13 +5,17 @@ xml:id="module-services-prometheus-exporters"> Prometheus exporters - Prometheus exporters provide metrics for the prometheus monitoring system. + Prometheus exporters provide metrics for the + prometheus monitoring system.
Configuration - One of the most common exporters is the node exporter, it provides hardware and OS metrics from the host it's running on. The exporter could be configured as follows: + One of the most common exporters is the + node + exporter, it provides hardware and OS metrics from the host it's + running on. The exporter could be configured as follows: services.prometheus.exporters.node = { enable = true; @@ -26,20 +30,34 @@ firewallFilter = "-i br0 -p tcp -m tcp --dport 9100"; }; - It should now serve all metrics from the collectors that are explicitly enabled and the ones that are enabled by default, via http under /metrics. In this example the firewall should just allow incoming connections to the exporter's port on the bridge interface br0 (this would have to be configured seperately of course). For more information about configuration see man configuration.nix or search through the available options. + It should now serve all metrics from the collectors that are explicitly + enabled and the ones that are + enabled + by default, via http under /metrics. In this + example the firewall should just allow incoming connections to the + exporter's port on the bridge interface br0 (this would + have to be configured seperately of course). For more information about + configuration see man configuration.nix or search through + the + available + options.
Adding a new exporter - To add a new exporter, it has to be packaged first (see nixpkgs/pkgs/servers/monitoring/prometheus/ for examples), then a module can be added. The postfix exporter is used in this example: + To add a new exporter, it has to be packaged first (see + nixpkgs/pkgs/servers/monitoring/prometheus/ for + examples), then a module can be added. The postfix exporter is used in this + example: - Some default options for all exporters are provided by nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix: + Some default options for all exporters are provided by + nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix: @@ -88,7 +106,11 @@ - As there is already a package available, the module can now be added. This is accomplished by adding a new file to the nixos/modules/services/monitoring/prometheus/exporters/ directory, which will be called postfix.nix and contains all exporter specific options and configuration: + As there is already a package available, the module can now be added. This + is accomplished by adding a new file to the + nixos/modules/services/monitoring/prometheus/exporters/ + directory, which will be called postfix.nix and contains all exporter + specific options and configuration: # nixpgs/nixos/modules/services/prometheus/exporters/postfix.nix { config, lib, pkgs, options }: @@ -155,16 +177,21 @@ in - This should already be enough for the postfix exporter. Additionally one could now add assertions and conditional default values. This can be done in the 'meta-module' that combines all exporter definitions and generates the submodules: nixpkgs/nixos/modules/services/prometheus/exporters.nix + This should already be enough for the postfix exporter. Additionally one + could now add assertions and conditional default values. This can be done + in the 'meta-module' that combines all exporter definitions and generates + the submodules: + nixpkgs/nixos/modules/services/prometheus/exporters.nix
Updating an exporter module - - - Should an exporter option change at some point, it is possible to add information about the change to the exporter definition similar to nixpkgs/nixos/modules/rename.nix: + + Should an exporter option change at some point, it is possible to add + information about the change to the exporter definition similar to + nixpkgs/nixos/modules/rename.nix: { config, lib, pkgs, options }: @@ -195,6 +222,6 @@ in ]; } - -
+ + -- cgit 1.4.1