2024-02-24 06:52:01 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
let host = "prometheus.moonythm.dev";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [ ../../common/optional/services/nginx.nix ];
|
|
|
|
|
|
|
|
# {{{ Main config
|
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
|
|
|
port = 8410;
|
|
|
|
webExternalUrl = host;
|
|
|
|
|
|
|
|
# {{{ Node exporter (system info)
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
port = 8411;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
scrapeConfigs = [{
|
|
|
|
job_name = "lapetus";
|
|
|
|
static_configs = [{
|
|
|
|
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
# }}}
|
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
# {{{ Networking & storage
|
|
|
|
services.nginx.virtualHosts.${host} =
|
|
|
|
config.satellite.proxy
|
2024-02-24 08:33:57 +01:00
|
|
|
config.services.prometheus.port
|
2024-02-24 06:52:01 +01:00
|
|
|
{ proxyWebsockets = true; };
|
|
|
|
|
2024-02-24 07:19:34 +01:00
|
|
|
environment.persistence."/persist/state".directories = [{
|
|
|
|
directory = "/var/lib/prometheus2";
|
|
|
|
user = "prometheus";
|
|
|
|
group = "prometheus";
|
|
|
|
}];
|
2024-02-24 06:52:01 +01:00
|
|
|
# }}}
|
|
|
|
}
|