diff --git a/hosts/proxy/default.nix b/hosts/proxy/default.nix index 9c09af9..83306c5 100644 --- a/hosts/proxy/default.nix +++ b/hosts/proxy/default.nix @@ -448,6 +448,7 @@ stats show-node stats show-modules stats admin if TRUE # Enable admin operations + http-request use-service prometheus-exporter if { path /metrics } frontend http-in bind *:80 @@ -547,8 +548,27 @@ ) "" forwards} ''; }; + vector.settings = { + sources.haproxy_metrics = { + type = "prometheus_scrape"; + endpoints = [ "http://127.0.0.1:8404/metrics" ]; + scrape_interval_secs = 15; + }; + transforms.add_host_label_haproxy = { + type = "remap"; + inputs = [ "haproxy_metrics" ]; + source = '' + .tags.host = get_hostname!() + ''; + }; + sinks.mimir.inputs = lib.mkForce [ + "add_host_label_metrics" + "add_host_label_haproxy" + ]; + }; }; + environment.systemPackages = with pkgs; [ ];