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 7 in 8 8 { 9 9 meta = { 10 - maintainers = with maintainers; [ zimbatm ]; 10 + maintainers = with maintainers; [ flokli zimbatm ]; 11 11 }; 12 12 13 13 options.services.grafana-agent = { ··· 49 49 }; 50 50 51 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 = { 52 + metrics = { 60 53 wal_directory = "\${STATE_DIRECTORY}"; 61 54 global.scrape_interval = "5s"; 62 55 }; ··· 69 62 }; 70 63 71 64 example = { 72 - loki.configs = [{ 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 = [{ 73 71 name = "default"; 74 72 scrape_configs = [ 75 73 { ··· 101 99 basic_auth.password_file = "\${CREDENTIALS_DIRECTORY}/logs_remote_write_password"; 102 100 }]; 103 101 }]; 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 102 }; 112 103 }; 113 104 };
+2 -2
nixos/tests/grafana-agent.nix
··· 23 23 24 24 with subtest("Grafana-agent is running"): 25 25 machine.wait_for_unit("grafana-agent.service") 26 - machine.wait_for_open_port(9090) 26 + machine.wait_for_open_port(12345) 27 27 machine.succeed( 28 - "curl -sSfN http://127.0.0.1:9090/-/healthy" 28 + "curl -sSfN http://127.0.0.1:12345/-/healthy" 29 29 ) 30 30 machine.shutdown() 31 31 '';