scrape haproxy metrics

This commit is contained in:
goeranh 2026-04-20 13:06:04 +02:00
parent e7cba90a45
commit fd02a136ef
No known key found for this signature in database

View file

@ -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,7 +548,26 @@
) "" 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; [
];