My Nix Configuration
1{ config, ... }: 2{ 3 services.prometheus = { 4 enable = true; 5 port = 6999; 6 exporters = { 7 node = { 8 enable = true; 9 enabledCollectors = [ "systemd" ]; 10 port = 6998; 11 }; 12 bird = { 13 enable = true; 14 }; 15 }; 16 scrapeConfigs = [ 17 { 18 job_name = "prefect"; 19 static_configs = [ 20 { targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ]; } 21 ]; 22 } 23 { 24 job_name = "caddy"; 25 static_configs = [ { targets = [ "127.0.0.1:6899" ]; } ]; 26 } 27 { 28 job_name = "bird"; 29 static_configs = [ { targets = [ "127.0.0.1:9324" ]; } ]; 30 } 31 { 32 job_name = "prometheus"; 33 static_configs = [ { targets = [ "127.0.0.1:6999" ]; } ]; 34 } 35 ]; 36 }; 37}