modules/prometheus: move to monitor directory
This commit is contained in:
parent
9e3af9a535
commit
97fcdefc2b
4 changed files with 0 additions and 0 deletions
70
modules/nixos/monitor/exporters.nix
Normal file
70
modules/nixos/monitor/exporters.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.custom.prometheus.exporters;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
systemd.services.tailscaled.after =
|
||||
(lib.optional cfg.node.enable "prometheus-node-exporters.service")
|
||||
++ (lib.optional cfg.blackbox.enable "prometheus-blackbox-exporters.service")
|
||||
++ (lib.optional config.services.caddy.enable "caddy.service");
|
||||
|
||||
services.prometheus.exporters.node = mkIf cfg.node.enable {
|
||||
enable = true;
|
||||
enabledCollectors = [
|
||||
"loadavg"
|
||||
"time"
|
||||
"systemd"
|
||||
];
|
||||
listenAddress = cfg.node.listenAddress;
|
||||
port = 9100;
|
||||
};
|
||||
|
||||
services.prometheus.exporters.blackbox = mkIf cfg.blackbox.enable {
|
||||
enable = true;
|
||||
listenAddress = cfg.blackbox.listenAddress;
|
||||
configFile = pkgs.writeText "blackbox.config.yaml" (
|
||||
lib.generators.toYAML { } {
|
||||
modules = {
|
||||
tcp4_connect = {
|
||||
prober = "tcp";
|
||||
tcp = {
|
||||
ip_protocol_fallback = false;
|
||||
preferred_ip_protocol = "ip4";
|
||||
tls = false;
|
||||
};
|
||||
timeout = "15s";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
services.gotosocial.settings = {
|
||||
metrics-enabled = true;
|
||||
};
|
||||
|
||||
services.immich.environment = {
|
||||
IMMICH_TELEMETRY_INCLUDE = "all";
|
||||
};
|
||||
|
||||
services.restic.server.prometheus = true;
|
||||
systemd.services.miniflux.environment.METRICS_COLLECTOR = "1";
|
||||
services.ntfy-sh.settings.enable-metrics = true;
|
||||
|
||||
services.caddy.globalConfig = ''
|
||||
servers {
|
||||
metrics
|
||||
}
|
||||
|
||||
admin ${config.networking.hostName}.coho-tet.ts.net:2019 {
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue