From 9d1bafb43326110f49b68ecbb4b2d0e89190996c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 8 Apr 2022 18:32:09 +0200 Subject: vidhar: ... --- hosts/vidhar/prometheus/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index 3f3c285b..1aa0c0b4 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix @@ -6,7 +6,7 @@ let relabelHosts = [ { source_labels = ["__address__"]; target_label = "instance"; - regex = "localhost(:[0-9]+)?"; + regex = "(localhost|127\.[0-9]+\.[0-9]+\.[0-9]+)(:[0-9]+)?"; replacement = "vidhar"; } { source_labels = ["__address__"]; @@ -225,15 +225,16 @@ in { { source_labels = ["__address__"]; target_label = "__param_target"; } - { source_labels = ["__param_target"]; + ] ++ relabelHosts ++ + [ { source_labels = ["__param_target"]; target_label = "instance"; regex = "127\.0\.0\.53:53"; - replacement = "systemd-resolved.vidhar"; + replacement = "systemd-resolved.dns_soa"; } { source_labels = ["__param_target"]; target_label = "instance"; regex = "127\.0\.0\.1:53"; - replacement = "unbound.vidhar"; + replacement = "unbound.dns_soa"; } { replacement = "localhost:${toString config.services.prometheus.exporters.blackbox.port}"; target_label = "__address__"; -- cgit v1.2.3