mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
22 lines
521 B
Nix
22 lines
521 B
Nix
{ config, hosts, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
prom_configs =
|
|
(mapAttrs (hostName: host: host.config.services.prometheus.exporters.node)
|
|
(filterAttrs
|
|
(_: host: host.config.services.prometheus.exporters.node.enable)
|
|
hosts));
|
|
in {
|
|
services.prometheus = {
|
|
enable = true;
|
|
scrapeConfigs = mapAttrsToList (hostName: prom: {
|
|
job_name = hostName;
|
|
static_configs = [{
|
|
targets = [ "${hostName}.net.kittywit.ch:${toString prom.port}" ];
|
|
}];
|
|
}) prom_configs;
|
|
};
|
|
}
|
|
|