2023-02-10 17:34:46 +00:00
|
|
|
{ config, pkgs, ... }: {
|
|
|
|
# Enable Prometheus exporters
|
|
|
|
services.prometheus = {
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
2023-03-19 15:07:48 +00:00
|
|
|
enabledCollectors = [
|
|
|
|
"systemd"
|
|
|
|
"cpu"
|
|
|
|
"cpufreq"
|
|
|
|
"diskstats"
|
|
|
|
"filesystem"
|
|
|
|
"meminfo"
|
|
|
|
"netstat"
|
|
|
|
"os"
|
|
|
|
];
|
2023-02-10 17:34:46 +00:00
|
|
|
port = 9002;
|
|
|
|
};
|
2023-03-06 19:43:10 +00:00
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
port = 9003;
|
|
|
|
};
|
2023-06-11 20:28:27 +00:00
|
|
|
process = {
|
|
|
|
enable = true;
|
|
|
|
port = 9005;
|
|
|
|
settings.process_names = [
|
|
|
|
# Remove nix store path from process name
|
|
|
|
{
|
|
|
|
name = "{{.Matches.Wrapped}} {{ .Matches.Args }}";
|
|
|
|
cmdline = [ "^/nix/store[^ ]*/(?P<Wrapped>[^ /]*) (?P<Args>.*)" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-02-10 17:34:46 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-25 13:24:09 +00:00
|
|
|
|
|
|
|
services.telegraf = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
|
|
|
inputs.x509_cert = {
|
|
|
|
sources = [ "https://technogothic.net:443" ];
|
|
|
|
interval = "10m";
|
|
|
|
};
|
|
|
|
outputs.prometheus_client = {
|
|
|
|
listen = "localhost:9004";
|
|
|
|
metric_version = 2;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-10 17:34:46 +00:00
|
|
|
}
|
|
|
|
|