feat(monitoring): add to utsuho

This commit is contained in:
Kat Inskip 2024-05-28 12:26:46 -07:00
parent 550cb044aa
commit 77fd991ed1
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
6 changed files with 21 additions and 3 deletions

View file

@ -29,7 +29,6 @@ in {
{ {
enabledCollectors = [ enabledCollectors = [
"arp" "arp"
"boottime"
"cpu" "cpu"
"cpufreq" "cpufreq"
"diskstats" "diskstats"

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: let }: let
inherit (builtins) toJSON; inherit (builtins) toJSON toString;
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) port; inherit (lib.types) port;
cfg = config.services.promtail; cfg = config.services.promtail;
@ -17,7 +17,7 @@ in {
}; };
config.services.promtail = { config.services.promtail = {
extraFlags = [ extraFlags = [
"--server.http-listen-port=${cfg.settings.httpListenPort}" "--server.http-listen-port=${toString cfg.settings.httpListenPort}"
]; ];
}; };
} }

View file

@ -0,0 +1,6 @@
_: {
services = {
prometheus.exporters.node.enable = true;
promtail.enable = true;
};
}

7
nixos/monitoring.nix Normal file
View file

@ -0,0 +1,7 @@
_: {
services = {
grafana.enable = true;
loki.enable = true;
prometheus.enable = true;
};
}

View file

@ -17,6 +17,11 @@ _: {
unifi.enable = true; unifi.enable = true;
mosquitto.enable = true; mosquitto.enable = true;
dnsmasq.enable = true; dnsmasq.enable = true;
grafana.enable = true;
loki.enable = true;
prometheus.enable = true;
prometheus-exporters-node.enable = true;
promtail.enable = true;
}; };
}; };
} }

View file

@ -19,6 +19,7 @@ in {
nixos.unifi nixos.unifi
nixos.dnsmasq nixos.dnsmasq
nixos.mosquitto nixos.mosquitto
nixos.monitoring
]; ];
services.cloudflared = let services.cloudflared = let