summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2021-12-20 10:57:31 -0500
committerGraham Christensen <graham@grahamc.com>2021-12-20 10:57:31 -0500
commit3907d19260520a2939d8463e0fe0a65bd6f60b37 (patch)
tree620dd7430b3eb02a191cfd1e5de5fda6c3bbcf8e /nixos
parentd3aee09b992c25f4788ca00e4654d055c0e553ac (diff)
downloadnixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar.gz
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar.bz2
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar.lz
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar.xz
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.tar.zst
nixpkgs-3907d19260520a2939d8463e0fe0a65bd6f60b37.zip
services.prometheus.exporters.fastly: add a smoke test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/fastly.nix2
-rw-r--r--nixos/tests/prometheus-exporters.nix13
2 files changed, 14 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix b/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix
index 551c61ba9e4..55a61c4949e 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix
@@ -33,7 +33,7 @@ in
       ${optionalString (cfg.tokenPath != null)
       "export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"}
       ${pkgs.prometheus-fastly-exporter}/bin/fastly-exporter \
-        -endpoint http://${cfg.listenAddress}:${toString cfg.port}/metrics
+        -listen http://${cfg.listenAddress}:${toString cfg.port}
         ${optionalString cfg.debug "-debug true"} \
         ${optionalString (cfg.configFile != null) "-config-file ${cfg.configFile}"}
     '';
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 008a5edd071..036c037e426 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -259,6 +259,19 @@ let
       '';
     };
 
+    fastly = {
+      exporterConfig = {
+        enable = true;
+        tokenPath = pkgs.writeText "token" "abc123";
+      };
+
+      # noop: fastly's exporter can't start without first talking to fastly
+      # see: https://github.com/peterbourgon/fastly-exporter/issues/87
+      exporterTest = ''
+        succeed("true");
+      '';
+    };
+
     fritzbox = {
       # TODO add proper test case
       exporterConfig = {