From 2cb6cfab9553184c1e6a10303cb832fe96080d00 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 22 May 2023 19:27:36 -0400 Subject: atlas/pbody: fix monitoring --- hosts/atlas/prometheus.nix | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'hosts/atlas') diff --git a/hosts/atlas/prometheus.nix b/hosts/atlas/prometheus.nix index b0c3f7b..041c407 100644 --- a/hosts/atlas/prometheus.nix +++ b/hosts/atlas/prometheus.nix @@ -1,33 +1,14 @@ -{config, ...}: let - scrapeExporter = name: host: port: { - job_name = "${name}"; - static_configs = [ - { - targets = [ - "${host}:${port}" - ]; - } - ]; - }; -in { - services.prometheus = { +{config, ...}: { + networking.firewall.allowedTCPPorts = [config.services.prometheus.exporters.node.port]; + + services.prometheus.exporters.node = { enable = true; - port = 5000; - exporters = { - node = { - enable = true; - enabledCollectors = ["systemd"]; - port = 5001; - }; - }; - scrapeConfigs = [ - (scrapeExporter "atlas" "127.0.0.1" "${toString config.services.prometheus.exporters.node.port}") - ]; + enabledCollectors = ["systemd"]; }; getchoo.server.services.promtail.clients = [ { - url = "p-body:3030/loki/api/v1/push"; + url = "http://p-body:3030/loki/api/v1/push"; } ]; } -- cgit v1.2.3