prometheus/fastly-exporter: drop workarounds
They were upstreamed into nixpkgs and have reached nixos-23.11.
Martin Weinelt committed
Feb 26, 2024 at 01:36 UTC
f2395b2924d6af3f9d5aa64a04ae1e0372ba6d50
1 file changed
+1
-13
delft/pluto/prometheus/exporters/fastly.nix
+1
-13
@@ -1,27 +1,15 @@
1
{ config
2
-, lib
3
-, pkgs
2
, ...
3
}:
4
5
{
6
age.secrets.fastly-read-only-api-token.file = ../../../secrets/fastly-read-only-api-token.age;
7
10
- systemd.services.prometheus-fastly-exporter = {
11
- # module script is outdated; https://github.com/NixOS/nixpkgs/pull/287348
12
- script = with config.services.prometheus.exporters.fastly; lib.mkForce ''
13
- export FASTLY_API_TOKEN=$(cat ${tokenPath})
14
- ${pkgs.prometheus-fastly-exporter}/bin/fastly-exporter \
15
- -listen ${listenAddress}:${toString port}
16
- '';
17
- serviceConfig.LoadCredential = "fastyl-api-token:${config.age.secrets.fastly-read-only-api-token.path}";
18
- };
19
-
8
services.prometheus = {
9
exporters.fastly = {
10
enable = true;
11
listenAddress = "127.0.0.1";
24
- tokenPath = "/run/credentials/prometheus-fastly-exporter.service/fastyl-api-token";
12
+ tokenPath = config.age.secrets.fastly-read-only-api-token.path;
13
};
14
15
scrapeConfigs = [ {