fix(monitoring): require exporter sockets from their services

Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
Ryan Yin committed 2026-11-17 22:43:59 +08:00
1 parent f02b06563e
commit 6bd97ddf98
1 file changed
+3
+3
View File
@@ -163,6 +163,9 @@ in
name: cfg:
lib.nameValuePair "prometheus-${name}-exporter" {
wantedBy = [ "sockets.target" ];
# nixpkgs also starts the service from multi-user.target; requiring the
# socket (which systemd orders first) keeps a switch from starting it bare.
requiredBy = [ "prometheus-${name}-exporter.service" ];
listenStreams = [ "${cfg.listenAddress}:${toString cfg.port}" ];
socketConfig.FreeBind = true;
}