nix-infra/common/fragments/prometheus_exporters.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }: {
# Enable Prometheus exporters
services.prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [
"systemd"
"cpu"
"cpufreq"
"diskstats"
"filesystem"
"meminfo"
"netstat"
"os"
];
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>.*)" ];
}
];
};
};
};
services.telegraf = {
enable = true;
extraConfig = {
inputs.x509_cert = {
sources = [ "https://technogothic.net:443" ];
interval = "10m";
};
outputs.prometheus_client = {
listen = "localhost:9004";
metric_version = 2;
};
};
};
}