{ config, pkgs, lib, ... }: let # Scrape a list of static targets for a job. staticScrape = (job_name: targets: { inherit job_name; static_configs = [{ inherit targets; }]; }); in { services.prometheus = { enable = true; globalConfig.scrape_interval = "15s"; extraFlags = [ # 3 years of retention "--storage.tsdb.retention=1095d" "--web.enable-admin-api" ]; scrapeConfigs = [ (staticScrape "node" [ "rtr:9100" "tahoe:9100" ]) ]; }; }