From 5b06a952223e9632e2a8241b0e6697df37fe81ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Wed, 28 May 2025 17:10:50 +0200 Subject: [PATCH] Add prometheus pushgateway --- services/http-proxy/proxy.nix | 8 ++++++++ services/monitoring/prometheus.nix | 14 ++++++++++++++ services/ns/zones-home-2rjus-net.conf | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/services/http-proxy/proxy.nix b/services/http-proxy/proxy.nix index 3a00d45..b753e56 100644 --- a/services/http-proxy/proxy.nix +++ b/services/http-proxy/proxy.nix @@ -106,6 +106,14 @@ } reverse_proxy http://monitoring01.home.2rjus.net:4040 } + pushgw.home.2rjus.net { + log { + output file /var/log/caddy/pushgw.log { + mode 644 + } + } + reverse_proxy http://monitoring01.home.2rjus.net:9091 + } http://http-proxy.home.2rjus.net/metrics { log { output file /var/log/caddy/caddy-metrics.log { diff --git a/services/monitoring/prometheus.nix b/services/monitoring/prometheus.nix index ea1d852..70f7ca1 100644 --- a/services/monitoring/prometheus.nix +++ b/services/monitoring/prometheus.nix @@ -199,6 +199,20 @@ } ]; } + { + job_name = "pushgateway"; + static_configs = [ + { + targets = [ "localhost:9091" ]; + } + ]; + } ]; + pushgateway = { + enable = true; + web = { + external-url = "https://pushgw.home.2rjus.net"; + }; + }; }; } diff --git a/services/ns/zones-home-2rjus-net.conf b/services/ns/zones-home-2rjus-net.conf index dc82215..5506bb4 100644 --- a/services/ns/zones-home-2rjus-net.conf +++ b/services/ns/zones-home-2rjus-net.conf @@ -1,7 +1,7 @@ $ORIGIN home.2rjus.net. $TTL 1800 @ IN SOA ns1.home.2rjus.net. admin.test.2rjus.net. ( - 2061 ; serial number + 2062 ; serial number 3600 ; refresh 900 ; retry 1209600 ; expire @@ -76,6 +76,7 @@ jelly IN CNAME http-proxy auth IN CNAME http-proxy lldap IN CNAME http-proxy pyroscope IN CNAME http-proxy +pushgw IN CNAME http-proxy ldap IN CNAME auth01