diff options
author | Martin Fischer <martin@push-f.com> | 2025-08-27 21:16:06 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-08-27 21:16:06 +0200 |
commit | b36ce740dd228ffadac42f17c1181901f25bc5c5 (patch) | |
tree | 65fab2e0a26f000d8ebce870c8dd1d3105e5fae4 /nixos | |
parent | 51194934f276d6df9835654175f8363fbeb4bdcf (diff) |
deps: update prometheus-sql-exporter
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/npins/sources.json | 6 | ||||
-rw-r--r-- | nixos/shared/prometheus-sql-exporter/default.nix | 2 | ||||
-rw-r--r-- | nixos/shared/prometheus-sql-exporter/service.nix | 13 |
3 files changed, 15 insertions, 6 deletions
diff --git a/nixos/npins/sources.json b/nixos/npins/sources.json index cde94e0..59befe6 100644 --- a/nixos/npins/sources.json +++ b/nixos/npins/sources.json @@ -116,10 +116,10 @@ "version_upper_bound": null, "release_prefix": null, "submodules": false, - "version": "0.17.1", - "revision": "5bd21bb0bc14a65d2b2e883f23c9acc338ad96d7", + "version": "0.18.1", + "revision": "6e73ff71a8976939c28ce9a0ddbeefe0801d0a37", "url": null, - "hash": "09vlgqhrdc5cfgbx7fz98vbj7cw1fpq35q7xskrdj7k5z9fcahq0" + "hash": "1a3j3rsjvw6wqyayml5x5c7x18bvn45ldr2p280yn9pqdzihk480" } }, "version": 5 diff --git a/nixos/shared/prometheus-sql-exporter/default.nix b/nixos/shared/prometheus-sql-exporter/default.nix index 4a08ff6..5d80a62 100644 --- a/nixos/shared/prometheus-sql-exporter/default.nix +++ b/nixos/shared/prometheus-sql-exporter/default.nix @@ -9,7 +9,7 @@ buildGoModule { pname = "sql_exporter"; version = sources.prometheus-sql-exporter.version; src = sources.prometheus-sql-exporter; - vendorHash = "sha256-KFWDqbdbXvgEtz1nlasWrvIckpzasUdzbb+AKfXmYf8="; + vendorHash = "sha256-eZxxmqoiXPdjZs/lwbzvWco9mDFy0zmpGDcqTIyWbK4="; meta = with lib; { description = "Database-agnostic SQL exporter for Prometheus"; diff --git a/nixos/shared/prometheus-sql-exporter/service.nix b/nixos/shared/prometheus-sql-exporter/service.nix index a887f91..a79528c 100644 --- a/nixos/shared/prometheus-sql-exporter/service.nix +++ b/nixos/shared/prometheus-sql-exporter/service.nix @@ -4,7 +4,16 @@ let sqlExporter = pkgs.callPackage ./default.nix {}; cfg = config.services.prometheus-sql-exporter; - configFile = builtins.toFile "config.yaml" (builtins.toJSON cfg.config); + configFile = builtins.toFile "config.yaml" (builtins.toJSON cfg.config); + validateConfig = file: + pkgs.runCommand "validate-config" + { + nativeBuildInputs = [sqlExporter]; + } + '' + sql_exporter -config.check -config.file "${file}" + ln -s "${file}" "$out" + ''; in { options.services.prometheus-sql-exporter = { @@ -20,7 +29,7 @@ in config = lib.mkIf cfg.enable { systemd.services.prometheus-sql-exporter = { serviceConfig = { - ExecStart = "${sqlExporter}/bin/sql_exporter -config.file ${configFile} -web.listen-address :${toString cfg.port}"; + ExecStart = "${sqlExporter}/bin/sql_exporter -config.file ${validateConfig configFile} -web.listen-address :${toString cfg.port}"; DynamicUser = "true"; User = "prometheus-sql-exporter"; }; |