1 import ../make-test-python.nix ({ lib, pkgs, ... }:
5 meta.maintainers = [ pkgs.lib.maintainers.happysalada ];
7 nodes.machine = { config, pkgs, ... }: {
10 journaldAccess = true;
13 journald.type = "journald";
15 vector_metrics.type = "internal_metrics";
17 vector_logs.type = "internal_logs";
23 inputs = [ "journald" "vector_logs" ];
24 path = "/var/lib/vector/logs.log";
25 encoding = { codec = "json"; };
28 prometheus_exporter = {
29 type = "prometheus_exporter";
30 inputs = [ "vector_metrics" ];
31 address = "[::]:9598";
38 # ensure vector is forwarding the messages appropriately
40 machine.wait_for_unit("vector.service")
41 machine.wait_for_open_port(9598)
42 machine.wait_until_succeeds("journalctl -o cat -u vector.service | grep 'version=\"${pkgs.vector.version}\"'")
43 machine.wait_until_succeeds("journalctl -o cat -u vector.service | grep 'API is disabled'")
44 machine.wait_until_succeeds("curl -sSf http://localhost:9598/metrics | grep vector_build_info")
45 machine.wait_until_succeeds("curl -sSf http://localhost:9598/metrics | grep vector_component_received_bytes_total | grep journald")
46 machine.wait_until_succeeds("curl -sSf http://localhost:9598/metrics | grep vector_utilization | grep prometheus_exporter")
47 machine.wait_for_file("/var/lib/vector/logs.log")