Merge pull request #195760 from jmbaur/prometheus-kea-exporter

authored by Martin Weinelt and committed by GitHub 5d2330dd 678b9947

+18 -7
+1 -1
nixos/modules/services/monitoring/prometheus/exporters/kea.nix
··· 35 35 ${pkgs.prometheus-kea-exporter}/bin/kea-exporter \ 36 36 --address ${cfg.listenAddress} \ 37 37 --port ${toString cfg.port} \ 38 - ${concatStringsSep " \\n" cfg.controlSocketPaths} 38 + ${concatStringsSep " " cfg.controlSocketPaths} 39 39 ''; 40 40 SupplementaryGroups = [ "kea" ]; 41 41 RestrictAddressFamilies = [
+17 -6
nixos/tests/prometheus-exporters.nix
··· 374 374 }; 375 375 376 376 kea = let 377 - controlSocketPath = "/run/kea/dhcp6.sock"; 377 + controlSocketPathV4 = "/run/kea/dhcp4.sock"; 378 + controlSocketPathV6 = "/run/kea/dhcp6.sock"; 378 379 in 379 380 { 380 381 exporterConfig = { 381 382 enable = true; 382 383 controlSocketPaths = [ 383 - controlSocketPath 384 + controlSocketPathV4 385 + controlSocketPathV6 384 386 ]; 385 387 }; 386 388 metricProvider = { 387 - systemd.services.prometheus-kea-exporter.after = [ "kea-dhcp6-server.service" ]; 388 - 389 389 services.kea = { 390 + dhcp4 = { 391 + enable = true; 392 + settings = { 393 + control-socket = { 394 + socket-type = "unix"; 395 + socket-name = controlSocketPathV4; 396 + }; 397 + }; 398 + }; 390 399 dhcp6 = { 391 400 enable = true; 392 401 settings = { 393 402 control-socket = { 394 403 socket-type = "unix"; 395 - socket-name = controlSocketPath; 404 + socket-name = controlSocketPathV6; 396 405 }; 397 406 }; 398 407 }; ··· 400 409 }; 401 410 402 411 exporterTest = '' 412 + wait_for_unit("kea-dhcp4-server.service") 403 413 wait_for_unit("kea-dhcp6-server.service") 404 - wait_for_file("${controlSocketPath}") 414 + wait_for_file("${controlSocketPathV4}") 415 + wait_for_file("${controlSocketPathV6}") 405 416 wait_for_unit("prometheus-kea-exporter.service") 406 417 wait_for_open_port(9547) 407 418 succeed(