45 lines
1.0 KiB
Nix
45 lines
1.0 KiB
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 =
|
|
let
|
|
inherit (lib)
|
|
filter
|
|
isAttrs
|
|
attrValues
|
|
;
|
|
in
|
|
map (v: "127.0.0.1:${builtins.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;
|
|
};
|
|
};
|
|
};
|
|
}
|