grimm-nixos-laptop/modules/prometheus.nix

38 lines
896 B
Nix

{ config, lib, ... }:
let
inherit (config.serverConfig) ports vhosts;
in
{
services.prometheus = {
enable = true;
port = vhosts.prometheus_host.port;
globalConfig.scrape_interval = "15s";
scrapeConfigs = [
{
job_name = "chrysalis";
static_configs = [
{
targets =
with lib;
map (v: "127.0.0.1:${toString v.port}") (
filter (v: (isAttrs v) && v.enable) (attrValues config.services.prometheus.exporters)
);
}
];
}
];
exporters = {
nginx.enable = true;
redis.enable = true;
domain.enable = true;
postgres.enable = true;
nginxlog.enable = true;
jitsi.enable = true;
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = ports.node_exporter.port;
};
};
};
}