Merge pull request #151427 from DeterminateSystems/fixup-fastly
services.prometheus.exporters.fastly: fixup broken module config
This commit is contained in:
@@ -32,10 +32,10 @@ in
|
||||
script = ''
|
||||
${optionalString (cfg.tokenPath != null)
|
||||
"export FASTLY_API_TOKEN=$(cat ${toString cfg.tokenPath})"}
|
||||
${pkgs.fastly-exporter}/bin/fastly-exporter \
|
||||
-endpoint http://${cfg.listenAddress}:${cfg.port}/metrics
|
||||
${pkgs.prometheus-fastly-exporter}/bin/fastly-exporter \
|
||||
-listen http://${cfg.listenAddress}:${toString cfg.port}
|
||||
${optionalString cfg.debug "-debug true"} \
|
||||
${optionalString cfg.configFile "-config-file ${cfg.configFile}"}
|
||||
${optionalString (cfg.configFile != null) "-config-file ${cfg.configFile}"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "fastly-exporter";
|
||||
version = "6.1.0";
|
||||
version = "7.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peterbourgon";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0my0pcxix5rk73m5ciz513nwmjcm7vjs6r8wg3vddm0xixv7zq94";
|
||||
sha256 = "sha256-KL+UfYuHtfQ9sKad7Q1KqIK4CFzDsIWvgG1YO1ZbUQc=";
|
||||
};
|
||||
|
||||
vendorSha256 = "1w9asky8h8l5gc0c6cv89m38qw50hyhma8qbsw3zirplhk9mb3r2";
|
||||
vendorSha256 = "sha256-yE7yvnyDfrrFdBmBBYe2gBU7b4gOWl5kfqkoblE51EQ=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Prometheus exporter for the Fastly Real-time Analytics API";
|
||||
|
||||
Reference in New Issue
Block a user