diff options
| author | Mel <einebeere@gmail.com> | 2024-12-23 02:14:01 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-12-23 02:14:01 +0100 |
| commit | 42c35b6333fad97c48762a39c2e079c80bf7833e (patch) | |
| tree | cb8bdc877f17b130e06ecbcd980e371954875820 /modules/foundation/monitoring/default.nix | |
| parent | 778e23735053e935c3af00490561fe65b8c7d02c (diff) | |
| download | network-42c35b6333fad97c48762a39c2e079c80bf7833e.tar.zst network-42c35b6333fad97c48762a39c2e079c80bf7833e.zip | |
Scrape metrics from Nginx service access logs
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'modules/foundation/monitoring/default.nix')
| -rw-r--r-- | modules/foundation/monitoring/default.nix | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/modules/foundation/monitoring/default.nix b/modules/foundation/monitoring/default.nix index a7bc185..2489948 100644 --- a/modules/foundation/monitoring/default.nix +++ b/modules/foundation/monitoring/default.nix @@ -1,4 +1,9 @@ -{ me, config, lib, ... }: +{ + me, + config, + lib, + ... +}: let inherit (lib) mkOption mkEnableOption types; @@ -10,17 +15,25 @@ let nodeExporterPort = 9001; cadvisorExporterPort = 9002; nginxExporterPort = 9113; + nginxLogExporterPort = 9117; dockerExporterPort = 9323; }; - serverConfiguration = import ./server.nix ({ - hosts = cfg.server.hosts; - victoriaAddress = me.tailscale.ip; - } // ports); + serverConfiguration = import ./server.nix ( + { + hosts = cfg.server.hosts; + victoriaAddress = "${me.tailscale.ip}:${toString ports.victoriaDefaultPort}"; + } + // ports + ); - clientConfiguration = import ./client.nix ({ - listenAddress = me.tailscale.ip; - } // ports); + clientConfiguration = import ./client.nix ( + { + services = cfg.services; + listenAddress = me.tailscale.ip; + } + // ports + ); in { imports = [ ../../../services/monitoring/wrapper.nix ]; @@ -30,12 +43,14 @@ in enable = mkEnableOption "monitoring server"; hosts = mkOption { - type = with types; listOf (submodule { - options = { - name = mkOption { type = str; }; - ip = mkOption { type = str; }; - }; - }); + type = + with types; + listOf (submodule { + options = { + name = mkOption { type = str; }; + ip = mkOption { type = str; }; + }; + }); default = [ ]; }; }; @@ -43,6 +58,11 @@ in client = { enable = mkEnableOption "monitoring client"; }; + + services = mkOption { + type = with types; listOf str; + default = [ ]; + }; }; config = lib.mkMerge [ |
