git.iko.soy/typeable/nixpkgs
on master help sign in
services.prometheus.exporters.fastly: add a smoke test
commit3907d19260520a2939d8463e0fe0a65bd6f60b37 authorGraham Christensen <graham@grahamc.com> dateMon 20 Dec 2021, 10:57 (5 years ago) parentd3aee09
2 files changed+14−1
nixos/modules/services/monitoring/prometheus/exporters/fastly.nix+1−1 nixos/tests/prometheus-exporters.nix+13
nixos/modules/services/monitoring/prometheus/exporters/fastly.nix+1−1
@@ -33,7 +33,7 @@ in
3333 ${optionalString (cfg.tokenPath != null)
3434 "export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"}
3535 ${pkgs.prometheus-fastly-exporter}/bin/fastly-exporter \
36− -endpoint http://${cfg.listenAddress}:${toString cfg.port}/metrics
36+ -listen http://${cfg.listenAddress}:${toString cfg.port}
3737 ${optionalString cfg.debug "-debug true"} \
3838 ${optionalString (cfg.configFile != null) "-config-file ${cfg.configFile}"}
3939 '';
nixos/tests/prometheus-exporters.nix+13
@@ -259,6 +259,19 @@ let
259259 '';
260260 };
261261
262+ fastly = {
263+ exporterConfig = {
264+ enable = true;
265+ tokenPath = pkgs.writeText "token" "abc123";
266+ };
267+
268+ # noop: fastly's exporter can't start without first talking to fastly
269+ # see: https://github.com/peterbourgon/fastly-exporter/issues/87
270+ exporterTest = ''
271+ succeed("true");
272+ '';
273+ };
274+
262275 fritzbox = {
263276 # TODO add proper test case
264277 exporterConfig = {