lol

Merge pull request #178224 from flokli/grafana-agent-module-fixes

nixos/grafana-agent: apply some fixes

authored by zimbatm.tngl.sh and committed by

GitHub c858c17c 9b24aab6

+10 -19
+8 -17
nixos/modules/services/monitoring/grafana-agent.nix
··· 7 in 8 { 9 meta = { 10 - maintainers = with maintainers; [ zimbatm ]; 11 }; 12 13 options.services.grafana-agent = { ··· 49 }; 50 51 default = { 52 - server = { 53 - # Don't bind on 0.0.0.0 54 - grpc_listen_address = "127.0.0.1"; 55 - http_listen_address = "127.0.0.1"; 56 - # Don't bind on the default port 80 57 - http_listen_port = 9090; 58 - }; 59 - prometheus = { 60 wal_directory = "\${STATE_DIRECTORY}"; 61 global.scrape_interval = "5s"; 62 }; ··· 69 }; 70 71 example = { 72 - loki.configs = [{ 73 name = "default"; 74 scrape_configs = [ 75 { ··· 101 basic_auth.password_file = "\${CREDENTIALS_DIRECTORY}/logs_remote_write_password"; 102 }]; 103 }]; 104 - integrations = { 105 - prometheus_remote_write = [{ 106 - url = "\${METRICS_REMOTE_WRITE_URL}"; 107 - basic_auth.username = "\${METRICS_REMOTE_WRITE_USERNAME}"; 108 - basic_auth.password_file = "\${CREDENTIALS_DIRECTORY}/metrics_remote_write_password"; 109 - }]; 110 - }; 111 }; 112 }; 113 };
··· 7 in 8 { 9 meta = { 10 + maintainers = with maintainers; [ flokli zimbatm ]; 11 }; 12 13 options.services.grafana-agent = { ··· 49 }; 50 51 default = { 52 + metrics = { 53 wal_directory = "\${STATE_DIRECTORY}"; 54 global.scrape_interval = "5s"; 55 }; ··· 62 }; 63 64 example = { 65 + metrics.global.remote_write = [{ 66 + url = "\${METRICS_REMOTE_WRITE_URL}"; 67 + basic_auth.username = "\${METRICS_REMOTE_WRITE_USERNAME}"; 68 + basic_auth.password_file = "\${CREDENTIALS_DIRECTORY}/metrics_remote_write_password"; 69 + }]; 70 + logs.configs = [{ 71 name = "default"; 72 scrape_configs = [ 73 { ··· 99 basic_auth.password_file = "\${CREDENTIALS_DIRECTORY}/logs_remote_write_password"; 100 }]; 101 }]; 102 }; 103 }; 104 };
+2 -2
nixos/tests/grafana-agent.nix
··· 23 24 with subtest("Grafana-agent is running"): 25 machine.wait_for_unit("grafana-agent.service") 26 - machine.wait_for_open_port(9090) 27 machine.succeed( 28 - "curl -sSfN http://127.0.0.1:9090/-/healthy" 29 ) 30 machine.shutdown() 31 '';
··· 23 24 with subtest("Grafana-agent is running"): 25 machine.wait_for_unit("grafana-agent.service") 26 + machine.wait_for_open_port(12345) 27 machine.succeed( 28 + "curl -sSfN http://127.0.0.1:12345/-/healthy" 29 ) 30 machine.shutdown() 31 '';