From 3907d19260520a2939d8463e0fe0a65bd6f60b37 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 20 Dec 2021 10:57:31 -0500 Subject: [PATCH] services.prometheus.exporters.fastly: add a smoke test --- .../monitoring/prometheus/exporters/fastly.nix | 2 +- nixos/tests/prometheus-exporters.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix b/nixos/modules/services/monitoring/prometheus/exporters/fastly.nix index 551c61ba9e44..55a61c4949ee 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 008a5edd071d..036c037e426c 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 = {