nixos-config/nixos/machines/chungus/telemetry/prometheus.nix

24 lines
578 B
Nix
Raw Normal View History

2023-04-29 23:29:05 +02:00
{ config, pkgs, lib, ... }: {
services.nginx = {
enable = true;
statusPage = true;
virtualHosts = {
2023-05-13 00:29:13 +02:00
"prometheus.${config.networking.hostName}.private" = {
2023-04-29 23:29:05 +02:00
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = { proxyPass = "http://localhost:${toString config.services.prometheus.port}"; };
};
};
};
services.prometheus = {
checkConfig = "syntax-only";
enable = true;
# keep data for 30 days
2023-07-29 09:29:38 +02:00
extraFlags = [ "--storage.tsdb.retention.time=90d" ];
2023-04-29 23:29:05 +02:00
};
}