2024-05-09 14:55:02 +02:00
|
|
|
{ config, lib, ... }:
|
2024-05-08 21:49:37 +02:00
|
|
|
let
|
2024-05-09 14:55:02 +02:00
|
|
|
inherit (config.serverConfig) ports vhosts;
|
2024-05-08 21:50:08 +02:00
|
|
|
in
|
|
|
|
{
|
2024-05-08 21:49:37 +02:00
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
2024-05-09 14:55:02 +02:00
|
|
|
port = vhosts.prometheus_host.port;
|
2024-05-08 21:49:37 +02:00
|
|
|
globalConfig.scrape_interval = "15s";
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "chrysalis";
|
2024-05-08 21:50:08 +02:00
|
|
|
static_configs = [
|
|
|
|
{
|
2024-05-09 14:55:02 +02:00
|
|
|
targets =
|
2024-05-11 22:55:59 +02:00
|
|
|
let
|
2024-09-28 22:09:24 +02:00
|
|
|
inherit (lib)
|
|
|
|
filter
|
|
|
|
isAttrs
|
|
|
|
attrValues
|
|
|
|
filterAttrs
|
|
|
|
;
|
2024-05-11 22:55:59 +02:00
|
|
|
in
|
2024-05-12 10:39:52 +02:00
|
|
|
map (v: "127.0.0.1:${builtins.toString v.port}") (
|
2024-09-28 22:09:24 +02:00
|
|
|
filter (v: (isAttrs v) && v.enable) (
|
|
|
|
attrValues (filterAttrs (n: v: n != "minio") config.services.prometheus.exporters)
|
|
|
|
)
|
2024-05-09 14:55:02 +02:00
|
|
|
);
|
2024-05-08 21:50:08 +02:00
|
|
|
}
|
|
|
|
];
|
2024-05-08 21:49:37 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
exporters = {
|
2024-09-28 22:09:24 +02:00
|
|
|
# nginx.enable = true;
|
2024-05-08 21:49:37 +02:00
|
|
|
redis.enable = true;
|
|
|
|
domain.enable = true;
|
|
|
|
postgres.enable = true;
|
|
|
|
nginxlog.enable = true;
|
|
|
|
jitsi.enable = true;
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
2024-05-09 14:55:02 +02:00
|
|
|
port = ports.node_exporter.port;
|
2024-05-08 21:49:37 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|