diff --git a/nixos/components/monitor/container.nix b/nixos/components/monitor/container.nix index 9dc46d6..947a5e8 100644 --- a/nixos/components/monitor/container.nix +++ b/nixos/components/monitor/container.nix @@ -4,15 +4,12 @@ with types; { imports = [ ./default.nix ]; - options.components.monitor.container.promtail.port = mkOption { - type = int; - }; - config = { components.monitor.enable = mkDefault true; components.monitor.metrics.enable = mkDefault false; - components.monitor.promtail.port = config.components.monitor.container.promtail.port; - components.monitor.opentelemetry.exporter.endpoint = mkDefault "127.0.0.1:4317"; + components.monitor.opentelemetry.enable = false; + + services.journald.extraConfig = "SystemMaxUse=1G"; }; } diff --git a/nixos/components/monitor/logs-promtail.nix b/nixos/components/monitor/logs-promtail.nix index 7ef67fd..4e685cc 100644 --- a/nixos/components/monitor/logs-promtail.nix +++ b/nixos/components/monitor/logs-promtail.nix @@ -19,8 +19,7 @@ in config = mkMerge [ - (mkIf config.components.monitor.promtail.enable { - + (mkIf config.components.monitor.opentelemetry.enable { services.opentelemetry-collector.settings = { receivers.loki = { protocols.http.endpoint = "127.0.0.1:${toString cfg.port}"; @@ -28,7 +27,9 @@ in }; service.pipelines.logs.receivers = [ "loki" ]; }; + }) + (mkIf config.components.monitor.promtail.enable { services.promtail = { enable = true; configuration = { diff --git a/nixos/components/monitor/opentelemetry.nix b/nixos/components/monitor/opentelemetry.nix index 5f4cf0b..2e5a0d6 100644 --- a/nixos/components/monitor/opentelemetry.nix +++ b/nixos/components/monitor/opentelemetry.nix @@ -6,6 +6,11 @@ let in { options.components.monitor.opentelemetry = { + enable = mkOption { + type = bool; + default = config.components.monitor.enable; + description = "weather or not to use opentelemetry"; + }; receiver.endpoint = mkOption { type = nullOr str; default = null; @@ -30,7 +35,7 @@ in config = mkMerge [ - (mkIf config.components.monitor.enable { + (mkIf config.components.monitor.opentelemetry.enable { services.opentelemetry-collector = { enable = true; package = pkgs.unstable.opentelemetry-collector-contrib; diff --git a/nixos/machines/orbi/media-nextcloud.nix b/nixos/machines/orbi/media-nextcloud.nix index 4fcf7bf..82eaf4b 100644 --- a/nixos/machines/orbi/media-nextcloud.nix +++ b/nixos/machines/orbi/media-nextcloud.nix @@ -90,9 +90,7 @@ in config = { config, lib, ... }: { nixpkgs.pkgs = pkgs; imports = [ ../../components/monitor/container.nix ]; - components.monitor.container.promtail.port = 3502; system.stateVersion = "23.11"; - services.journald.extraConfig = "SystemMaxUse=1G"; # Configuring nameservers for containers is currently broken. # Therefore in some cases internet connectivity can be broken inside the containers. diff --git a/nixos/machines/orbi/media-transmission2.nix b/nixos/machines/orbi/media-transmission2.nix index f29f29b..6bd2c9e 100644 --- a/nixos/machines/orbi/media-transmission2.nix +++ b/nixos/machines/orbi/media-transmission2.nix @@ -26,9 +26,7 @@ in config = { config, lib, ... }: { nixpkgs.pkgs = pkgs; imports = [ ../../components/monitor/container.nix ]; - components.monitor.container.promtail.port = 3505; system.stateVersion = "21.05"; - services.journald.extraConfig = "SystemMaxUse=1G"; # allow transmission to write in syncthing folders users.groups.syncthing = { diff --git a/nixos/machines/orbi/service-photoprism.nix b/nixos/machines/orbi/service-photoprism.nix index a1cd78e..0a028bd 100644 --- a/nixos/machines/orbi/service-photoprism.nix +++ b/nixos/machines/orbi/service-photoprism.nix @@ -16,9 +16,7 @@ in config = { config, lib, ... }: { nixpkgs.pkgs = pkgs; imports = [ ../../components/monitor/container.nix ]; - components.monitor.container.promtail.port = 3503; system.stateVersion = "23.11"; - services.journald.extraConfig = "SystemMaxUse=1G"; # Photoprism # ---------- diff --git a/nixos/machines/orbi/social-matrix-terranix.nix b/nixos/machines/orbi/social-matrix-terranix.nix index 80e5f90..8a1ccd9 100644 --- a/nixos/machines/orbi/social-matrix-terranix.nix +++ b/nixos/machines/orbi/social-matrix-terranix.nix @@ -71,7 +71,6 @@ in config = { config, lib, ... }: { nixpkgs.pkgs = pkgs; imports = [ ../../components/monitor/container.nix ]; - components.monitor.container.promtail.port = 3504; system.stateVersion = "23.11"; services.postgresql = {