1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00

services.prometheus.exporters.fastly: add a smoke test

This commit is contained in:
Graham Christensen 2021-12-20 10:57:31 -05:00
parent d3aee09b99
commit 3907d19260
2 changed files with 14 additions and 1 deletions

View file

@ -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}"}
'';

View file

@ -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 = {