diff options
author | Gaël Reyrol <me@gaelreyrol.dev> | 2023-06-25 18:41:35 +0200 |
---|---|---|
committer | Gaël Reyrol <me@gaelreyrol.dev> | 2023-06-27 20:50:58 +0200 |
commit | e11f06a9517b306691231e8a4207365e48cc9d5c (patch) | |
tree | 26ebcbf9ba9a3328a729777c16ada86d3b56f759 /nixos/modules/services/monitoring/prometheus/exporters | |
parent | 1602b60660fb76e78fbedd4f4eb80f99177bd5e1 (diff) |
services/prometheus/exporters: add scaphandre
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/exporters')
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix b/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix new file mode 100644 index 0000000000000..3b6ebf65b0903 --- /dev/null +++ b/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix @@ -0,0 +1,33 @@ +{ config +, lib +, pkgs +, options +}: + +let + logPrefix = "services.prometheus.exporter.scaphandre"; + cfg = config.services.prometheus.exporters.scaphandre; +in { + port = 8080; + extraOpts = { + telemetryPath = lib.mkOption { + type = lib.types.str; + default = "/metrics"; + description = lib.mdDoc '' + Path under which to expose metrics. + ''; + }; + }; + + serviceOpts = { + serviceConfig = { + ExecStart = '' + ${pkgs.scaphandre}/bin/scaphandre prometheus \ + --address ${cfg.listenAddress} \ + --port ${toString cfg.port} \ + --suffix ${cfg.telemetryPath} \ + ${lib.concatStringsSep " \\\n " cfg.extraFlags} + ''; + }; + }; +} |