diff options
| author | Mel <einebeere@gmail.com> | 2024-12-20 03:38:23 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-12-20 03:38:23 +0100 |
| commit | 25f79f137d6870af1a78379d196fb951589a67b7 (patch) | |
| tree | 8c0f64ecc7fd9fd8015cf70dcd7ce3a4777eef8d | |
| parent | 900f2345281cdaace7fe4a1258c99e83abb3aa2b (diff) | |
| download | network-25f79f137d6870af1a78379d196fb951589a67b7.tar.zst network-25f79f137d6870af1a78379d196fb951589a67b7.zip | |
Allow access to VictoriaMetrics from tailnet
Signed-off-by: Mel <einebeere@gmail.com>
| -rw-r--r-- | modules/foundation/monitoring.nix | 2 | ||||
| -rw-r--r-- | services/monitoring/default.nix | 4 | ||||
| -rw-r--r-- | services/monitoring/wrapper.nix | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/modules/foundation/monitoring.nix b/modules/foundation/monitoring.nix index 484350f..34ff810 100644 --- a/modules/foundation/monitoring.nix +++ b/modules/foundation/monitoring.nix @@ -37,7 +37,7 @@ in services.vmagent = { enable = true; - remoteWrite.url = "http://127.0.0.1:${toString victoriaDefaultPort}/api/v1/write"; + remoteWrite.url = "http://${me.tailscale.ip}:${toString victoriaDefaultPort}/api/v1/write"; prometheusConfig = { global = { diff --git a/services/monitoring/default.nix b/services/monitoring/default.nix index 60374b5..cf966fb 100644 --- a/services/monitoring/default.nix +++ b/services/monitoring/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, auxiliaryPkgs, ... }: +{ me, lib, pkgs, auxiliaryPkgs, ... }: let inherit (pkgs) victoriametrics grafana dockerTools; @@ -37,7 +37,7 @@ in foundation.service.monitoring = { victoria = { image = victoriaImage; - ports = [ victoriaLocalPort ]; + ports = [ (common.tailnetPort me victoriaLocalPort) ]; volumes = [ [ "${victoriaDir}" "/var/lib/victoria" ] diff --git a/services/monitoring/wrapper.nix b/services/monitoring/wrapper.nix index 416ae22..62c860b 100644 --- a/services/monitoring/wrapper.nix +++ b/services/monitoring/wrapper.nix @@ -1,6 +1,6 @@ # This wraps the monitoring service module to allow it to be # imported conditionally. -{ lib, pkgs, auxiliaryPkgs, config, ... }: +{ me, lib, pkgs, auxiliaryPkgs, config, ... }: let enabled = config.foundation.internal.monitoringService; @@ -11,5 +11,5 @@ in monitoringService = lib.mkEnableOption "monitoring service"; }; - config = lib.mkIf enabled (module { inherit lib pkgs auxiliaryPkgs; }); + config = lib.mkIf enabled (module { inherit me lib pkgs auxiliaryPkgs; }); } |
