Merge pull request #151427 from DeterminateSystems/fixup-fastly
services.prometheus.exporters.fastly: fixup broken module config
commitd86330d54e09a30de70dc04e1f97b0b90d7217bb
authorGraham Christensen <graham@grahamc.com>
dateMon 20 Dec 2021, 15:26 (5 years ago)
parent54c09543907d19
nixos/modules/services/monitoring/prometheus/exporters/fastly.nix+3−3
@@ -32,10 +32,10 @@ in
3232 script = ''
3333 ${optionalString (cfg.tokenPath != null)
3434 "export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"}
35− ${pkgs.fastly-exporter}/bin/fastly-exporter \
36− -endpoint http://${cfg.listenAddress}:${cfg.port}/metrics
35+ ${pkgs.prometheus-fastly-exporter}/bin/fastly-exporter \
36+ -listen http://${cfg.listenAddress}:${toString cfg.port}
3737 ${optionalString cfg.debug "-debug true"} \
38− ${optionalString cfg.configFile "-config-file ${cfg.configFile}"}
38+ ${optionalString (cfg.configFile != null) "-config-file ${cfg.configFile}"}
3939 '';
4040 };
4141}
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 = {
pkgs/servers/monitoring/prometheus/fastly-exporter.nix+3−3
@@ -2,16 +2,16 @@
22
33buildGoModule rec {
44 pname = "fastly-exporter";
5− version = "6.1.0";
5+ version = "7.0.1";
66
77 src = fetchFromGitHub {
88 owner = "peterbourgon";
99 repo = pname;
1010 rev = "v${version}";
11− sha256 = "0my0pcxix5rk73m5ciz513nwmjcm7vjs6r8wg3vddm0xixv7zq94";
11+ sha256 = "sha256-KL+UfYuHtfQ9sKad7Q1KqIK4CFzDsIWvgG1YO1ZbUQc=";
1212 };
1313
14− vendorSha256 = "1w9asky8h8l5gc0c6cv89m38qw50hyhma8qbsw3zirplhk9mb3r2";
14+ vendorSha256 = "sha256-yE7yvnyDfrrFdBmBBYe2gBU7b4gOWl5kfqkoblE51EQ=";
1515
1616 meta = with lib; {
1717 description = "Prometheus exporter for the Fastly Real-time Analytics API";