about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorJanik <80165193+Janik-Haag@users.noreply.github.com>2023-08-26 21:21:11 +0200
committerGitHub <noreply@github.com>2023-08-26 21:21:11 +0200
commit321734bc2be5e59cc202fd699a2466a094abb801 (patch)
treeeb87d30c89c5d5a31eeabedbd9bd4a7c07b90338 /nixos/modules/services/monitoring
parent6b90730466e7793e8c10ac9e8f6c7cf517faab36 (diff)
parentf0b76e7d10becb4b200939f42242d2fa5d912e7b (diff)
downloadnixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar.gz
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar.bz2
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar.lz
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar.xz
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.tar.zst
nixlib-321734bc2be5e59cc202fd699a2466a094abb801.zip
Merge pull request #251157 from NetaliDev/vmagent-extra-options
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/vmagent.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/vmagent.nix b/nixos/modules/services/monitoring/vmagent.nix
index c793bb073199..0e2ffb31c57c 100644
--- a/nixos/modules/services/monitoring/vmagent.nix
+++ b/nixos/modules/services/monitoring/vmagent.nix
@@ -62,6 +62,16 @@ in {
         Whether to open the firewall for the default ports.
       '';
     };
+
+    extraArgs = mkOption {
+      type = types.listOf types.str;
+      default = [];
+      description = lib.mdDoc ''
+        Extra args to pass to `vmagent`. See the docs:
+        <https://docs.victoriametrics.com/vmagent.html#advanced-usage>
+        or {command}`vmagent -help` for more information.
+      '';
+    };
   };
 
   config = mkIf cfg.enable {
@@ -90,7 +100,7 @@ in {
         Type = "simple";
         Restart = "on-failure";
         WorkingDirectory = cfg.dataDir;
-        ExecStart = "${cfg.package}/bin/vmagent -remoteWrite.url=${cfg.remoteWriteUrl} -promscrape.config=${prometheusConfig}";
+        ExecStart = "${cfg.package}/bin/vmagent -remoteWrite.url=${cfg.remoteWriteUrl} -promscrape.config=${prometheusConfig} ${escapeShellArgs cfg.extraArgs}";
       };
     };