summary refs log tree commit diff
path: root/nixos/tests/prometheus-exporters.nix
diff options
context:
space:
mode:
authorAmanda Cameron <amanda@darkdna.net>2021-11-19 13:52:49 -0500
committerAmanda Cameron <amanda@darkdna.net>2021-11-19 13:52:49 -0500
commitf1bcb88bf6b075856570c433014ed123d53abdc0 (patch)
treeb6daa0b0674a84c6f7eba4c1a9e201b004b1ddda /nixos/tests/prometheus-exporters.nix
parent4bfe837a586c8ecc1bc577207faf15c152dd1e22 (diff)
downloadnixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar.gz
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar.bz2
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar.lz
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar.xz
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.tar.zst
nixpkgs-f1bcb88bf6b075856570c433014ed123d53abdc0.zip
nixos/tests/prometheus-exporters: Add a test to cover a regression.
Diffstat (limited to 'nixos/tests/prometheus-exporters.nix')
-rw-r--r--nixos/tests/prometheus-exporters.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 38b93c4087c..55877b0e10d 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -1123,6 +1123,10 @@ let
     systemd = {
       exporterConfig = {
         enable = true;
+
+        extraFlags = [
+          "--collector.enable-restart-count"
+        ];
       };
       metricProvider = { };
       exporterTest = ''
@@ -1133,6 +1137,11 @@ let
                 'systemd_unit_state{name="basic.target",state="active",type="target"} 1'
             )
         )
+        succeed(
+            "curl -sSf localhost:9558/metrics | grep '{}'".format(
+                'systemd_service_restart_total{state="prometheus-systemd-exporter.service"} 0'
+            )
+        )
       '';
     };