From 5c4284d68c89a2be435b6c0df491d36e4eb5a8ab Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 5 Apr 2021 13:18:43 +0200 Subject: [PATCH] fuuko: Add dnsmasq prometheus exporter --- machines/fuuko/services/dnsmasq.nix | 6 ++++++ machines/fuuko/services/prometheus.nix | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/machines/fuuko/services/dnsmasq.nix b/machines/fuuko/services/dnsmasq.nix index a586492..f49e8d0 100644 --- a/machines/fuuko/services/dnsmasq.nix +++ b/machines/fuuko/services/dnsmasq.nix @@ -24,6 +24,12 @@ ]; }; + services.prometheus.exporters.dnsmasq = { + enable = true; + listenAddress = "127.0.0.1"; + leasesPath = "/var/lib/dnsmasq/dnsmasq.leases"; + }; + services.stubby = { enable = true; listenAddresses = [ diff --git a/machines/fuuko/services/prometheus.nix b/machines/fuuko/services/prometheus.nix index ec12b64..8a020d8 100644 --- a/machines/fuuko/services/prometheus.nix +++ b/machines/fuuko/services/prometheus.nix @@ -111,6 +111,14 @@ in replacement = "ci.sbruder.de"; }; } + { + job_name = "dnsmasq"; + static_configs = mkStaticTarget (with config.services.prometheus.exporters.dnsmasq; "${listenAddress}:${toString port}"); + relabel_configs = lib.singleton { + target_label = "instance"; + replacement = "fuuko.home.sbruder.de"; + }; + } ]; rules =