From afd1c72cdb83f129395e8df40bb7beaf2f2448b3 Mon Sep 17 00:00:00 2001 From: notohh Date: Mon, 19 Jun 2023 12:47:01 -0400 Subject: [PATCH] hosts: consolidate prometheus --- hosts/arashi/services/default.nix | 1 - hosts/arashi/services/prometheus.nix | 24 ------------------------ hosts/kariru/services/default.nix | 1 - hosts/kariru/services/prometheus.nix | 24 ------------------------ hosts/sakura/services/default.nix | 1 - hosts/sakura/services/forgejo.nix | 5 +++++ hosts/sakura/services/prometheus.nix | 23 ----------------------- hosts/yuki/services/default.nix | 1 - hosts/yuki/services/prometheus.nix | 24 ------------------------ 9 files changed, 5 insertions(+), 99 deletions(-) delete mode 100644 hosts/arashi/services/prometheus.nix delete mode 100644 hosts/kariru/services/prometheus.nix delete mode 100644 hosts/sakura/services/prometheus.nix delete mode 100644 hosts/yuki/services/prometheus.nix diff --git a/hosts/arashi/services/default.nix b/hosts/arashi/services/default.nix index a574ade..f3c8b4a 100644 --- a/hosts/arashi/services/default.nix +++ b/hosts/arashi/services/default.nix @@ -2,6 +2,5 @@ _: { imports = [ ./postgresql.nix ./redis.nix - ./prometheus.nix ]; } diff --git a/hosts/arashi/services/prometheus.nix b/hosts/arashi/services/prometheus.nix deleted file mode 100644 index 928d912..0000000 --- a/hosts/arashi/services/prometheus.nix +++ /dev/null @@ -1,24 +0,0 @@ -_: { - networking.firewall.allowedTCPPorts = [9090]; - services.prometheus = { - enable = true; - scrapeConfigs = [ - { - job_name = "prometheus"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9090"];}]; - } - { - job_name = "node"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9100"];}]; - } - ]; - exporters = { - node = { - enable = true; - enabledCollectors = ["systemd" "cpu"]; - }; - }; - }; -} diff --git a/hosts/kariru/services/default.nix b/hosts/kariru/services/default.nix index 7cf6424..92c06ca 100644 --- a/hosts/kariru/services/default.nix +++ b/hosts/kariru/services/default.nix @@ -2,7 +2,6 @@ _: { imports = [ ./traefik.nix ./torrent.nix - ./prometheus.nix ]; services.radarr = { enable = true; diff --git a/hosts/kariru/services/prometheus.nix b/hosts/kariru/services/prometheus.nix deleted file mode 100644 index 928d912..0000000 --- a/hosts/kariru/services/prometheus.nix +++ /dev/null @@ -1,24 +0,0 @@ -_: { - networking.firewall.allowedTCPPorts = [9090]; - services.prometheus = { - enable = true; - scrapeConfigs = [ - { - job_name = "prometheus"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9090"];}]; - } - { - job_name = "node"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9100"];}]; - } - ]; - exporters = { - node = { - enable = true; - enabledCollectors = ["systemd" "cpu"]; - }; - }; - }; -} diff --git a/hosts/sakura/services/default.nix b/hosts/sakura/services/default.nix index 4817f23..ef4b5e0 100644 --- a/hosts/sakura/services/default.nix +++ b/hosts/sakura/services/default.nix @@ -10,6 +10,5 @@ ./hedgedoc.nix ./dashdot.nix ./grafana.nix - ./prometheus.nix ]; } diff --git a/hosts/sakura/services/forgejo.nix b/hosts/sakura/services/forgejo.nix index 8b29ff7..aaf79e0 100644 --- a/hosts/sakura/services/forgejo.nix +++ b/hosts/sakura/services/forgejo.nix @@ -31,6 +31,11 @@ USER = "forgejo"; PASSWD = "forgejo"; }; + metrics = { + ENABLED = true; + ENABLED_ISSUE_BY_REPOSITORY = true; + ENABLED_ISSUE_BY_LABEL = true; + }; }; }; } diff --git a/hosts/sakura/services/prometheus.nix b/hosts/sakura/services/prometheus.nix deleted file mode 100644 index 1941647..0000000 --- a/hosts/sakura/services/prometheus.nix +++ /dev/null @@ -1,23 +0,0 @@ -_: { - services.prometheus = { - enable = true; - scrapeConfigs = [ - { - job_name = "prometheus"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9090"];}]; - } - { - job_name = "node"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9100"];}]; - } - ]; - exporters = { - node = { - enable = true; - enabledCollectors = ["systemd" "cpu"]; - }; - }; - }; -} diff --git a/hosts/yuki/services/default.nix b/hosts/yuki/services/default.nix index 406e829..1a1402f 100644 --- a/hosts/yuki/services/default.nix +++ b/hosts/yuki/services/default.nix @@ -8,6 +8,5 @@ ./homarr.nix ./dashdot.nix ./miniflux.nix - ./prometheus.nix ]; } diff --git a/hosts/yuki/services/prometheus.nix b/hosts/yuki/services/prometheus.nix deleted file mode 100644 index 928d912..0000000 --- a/hosts/yuki/services/prometheus.nix +++ /dev/null @@ -1,24 +0,0 @@ -_: { - networking.firewall.allowedTCPPorts = [9090]; - services.prometheus = { - enable = true; - scrapeConfigs = [ - { - job_name = "prometheus"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9090"];}]; - } - { - job_name = "node"; - scrape_interval = "30s"; - static_configs = [{targets = ["localhost:9100"];}]; - } - ]; - exporters = { - node = { - enable = true; - enabledCollectors = ["systemd" "cpu"]; - }; - }; - }; -}