36 lines
750 B
Nix
36 lines
750 B
Nix
{ config, pkgs, ... }:
|
|
let
|
|
#svcDomain = "status.${config.networking.domain}";
|
|
svcPort = config.services.prometheus.exporters.node.port;
|
|
in
|
|
{
|
|
#services.caddy.virtualHosts."${svcDomain}".extraConfig = ''
|
|
#reverse_proxy :${svcPort}
|
|
#'';
|
|
|
|
services.prometheus = {
|
|
enable = true;
|
|
port = 9090;
|
|
#globalConfig.scrape_interval = "10s"; # "1m"
|
|
|
|
exporters = {
|
|
# Export data about this host
|
|
node = {
|
|
enable = true;
|
|
enabledCollectors = [ "systemd" ];
|
|
port = 9091;
|
|
};
|
|
};
|
|
|
|
# Read data from the export
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "node-lithium";
|
|
static_configs = [{
|
|
targets = [ "localhost:${toString svcPort}" ];
|
|
}];
|
|
}
|
|
];
|
|
};
|
|
|
|
}
|