diff options
author | Bas van Dijk <bas@van.dijk.ch> | 2021-11-07 14:45:40 +0000 |
---|---|---|
committer | Bas van Dijk <bas@van.dijk.ch> | 2021-11-07 14:45:40 +0000 |
commit | 0e4abb0df773cf7d9ff8dc2792358c0b8508d5eb (patch) | |
tree | 6f5522bfd1bf27f3d39d4a3f6cc763b78d8e6ee1 /nixos/tests/prometheus.nix | |
parent | dd1edacb7bb7d60af46467c1d27c1c457d33210b (diff) |
nixos/prometheus: remove services.prometheus.environmentFile
The option `services.prometheus.environmentFile` has been removed since it was causing [issues](https://github.com/NixOS/nixpkgs/issues/126083) and Prometheus now has native support for secret files.
Diffstat (limited to 'nixos/tests/prometheus.nix')
-rw-r--r-- | nixos/tests/prometheus.nix | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/nixos/tests/prometheus.nix b/nixos/tests/prometheus.nix index d102b4c075186..20f8c4459e10c 100644 --- a/nixos/tests/prometheus.nix +++ b/nixos/tests/prometheus.nix @@ -130,14 +130,10 @@ in import ./make-test-python.nix { # This configuration just adds a new prometheus job # to scrape the node_exporter metrics of the s3 machine. - # We also use an environmentFile to test if that works correctly. services.prometheus = { - environmentFile = pkgs.writeText "prometheus-config-env-file" '' - JOB_NAME=s3-node_exporter - ''; scrapeConfigs = [ { - job_name = "$JOB_NAME"; + job_name = "s3-node_exporter"; static_configs = [ { targets = [ "s3:9100" ]; @@ -232,11 +228,6 @@ in import ./make-test-python.nix { # Check if prometheus responds to requests: prometheus.wait_for_unit("prometheus.service") - # Check if prometheus' config file is correctly locked down because it could contain secrets. - prometheus.succeed( - "stat -c '%a %U' /var/lib/prometheus2/prometheus-substituted.yaml | grep '600 prometheus'" - ) - prometheus.wait_for_open_port(${toString queryPort}) prometheus.succeed("curl -sf http://127.0.0.1:${toString queryPort}/metrics") |