From 11d839f3c3a1596bf3854353ae1261882881234d Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sun, 22 Sep 2024 14:45:12 +0300 Subject: [PATCH] feat(systems/hosts/metrics): revamp scrape_configs --- systems/hosts/metrics/default.nix | 41 +++++++------------------------ 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/systems/hosts/metrics/default.nix b/systems/hosts/metrics/default.nix index 99cbc40..90adbd2 100644 --- a/systems/hosts/metrics/default.nix +++ b/systems/hosts/metrics/default.nix @@ -1,4 +1,4 @@ -{...}: let +{artautil, ...}: let influxDB2Port = 8086; prometheusPort = 9090; lokiPort = 9091; @@ -29,66 +29,43 @@ in { job_name = "prometheus"; static_configs = [ { - targets = ["localhost:${toString prometheusPort}"]; + targets = ["metrics.home.arpa:${toString prometheusPort}"]; } ]; } - # lxcmetrics - # node, systemd { - job_name = "lxcmetrics_job"; + job_name = "node"; static_configs = [ { - targets = ["localhost:9100" "localhost:9558"]; + targets = map (x: x + ":9100") (builtins.attrNames (artautil.getDNSEntries "lxc")); } ]; } - # lxcproxy - # haproxy, node, systemd { - job_name = "lxcproxy_job"; + job_name = "systemd"; static_configs = [ { - targets = ["10.1.2.10:8404" "10.1.2.10:9100" "10.1.2.10:9558"]; + targets = map (x: x + ":9558") (builtins.attrNames (artautil.getDNSEntries "lxc")); } ]; } - # lxccloud - # node, systemd { - job_name = "lxccloud_job"; + job_name = "haproxy"; static_configs = [ { - targets = ["10.1.2.15:9100" "10.1.2.15:9558"]; + targets = ["proxy.home.arpa:8404"]; } ]; } - # uwulpine vm - { - job_name = "node_uwulpine"; - static_configs = [ - { - targets = ["10.1.1.10:9091"]; - } - ]; - } - { - job_name = "cadvisor_uwulpine"; - static_configs = [ - { - targets = ["10.1.1.10:9092"]; - } - ]; - } { job_name = "jellyfin"; static_configs = [ { - targets = ["10.1.2.20:8096"]; + targets = ["10.1.2.30:8096"]; } ]; } -- 2.44.1