{ config, lib, masterDomain, ... }: let cfg = config.os.srv.prometheus; in { options.os.srv.prometheus.enable = lib.mkEnableOption "enables prometheus"; config = lib.mkIf cfg.enable { services.prometheus = { enable = true; port = 9090; scrapeConfigs = [ { job_name = "prometheus"; static_configs = [ { targets = [ "127.0.0.1:9090" ]; } ]; } { job_name = "node-hardware"; static_configs = [ { targets = [ "127.0.0.1:9100" ]; } ]; } { job_name = "node_exporter"; static_configs = [ { targets = [ "127.0.0.1:9100" ]; } ]; } { job_name = "bare_metal_host_netdata"; scheme = "https"; metrics_path = "/api/v1/allmetrics"; params = { format = [ "prometheus" ]; }; static_configs = [ { targets = [ "netdata.${masterDomain}" ]; } ]; } { job_name = "uptime_kuma"; metrics_path = "/metrics"; static_configs = [ { targets = [ "127.0.0.1:3001" ]; } ]; } { job_name = "network-latency"; static_configs = [ { targets = [ "127.0.0.1:9374" ]; } ]; } ]; exporters = { node = { enable = true; enableCollectors = [ "systemd" ]; port = 9100; }; smokeping = { enable = true; listenAddress = "127.0.0.1"; hosts = [ "10.0.0.1" # Personal Router "192.168.0.1" # ISP Modem Box "84.116.254.69" # First ISP Hop "185.182.244.39" # Regional Katowice Hub "1.1.1.1" # Cloudflare DNS "8.8.8.8" # Google DNS "130.162.223.123" # OCI Instance ]; }; }; }; }; }