Monitoring

This commit is contained in:
Kat Inskip 2023-07-29 10:35:09 -07:00
parent d32283137a
commit ab8885a907
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,12 @@
{
config,
pkgs,
...
}: {
services.grafana = {
enable = true;
domain = "mon.kittywit.ch";
port = 2342;
addr = "127.0.0.1";
};
}

View file

@ -0,0 +1,8 @@
{config, ...}: {
services.nginx.virtualHosts.${config.services.grafana.domain} = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
proxyWebsockets = true;
};
};
}

View file

@ -0,0 +1,23 @@
{config, ...}: {
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "${config.networking.hostName}";
static_configs = [
{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
}
];
}
];
};
}

View file

@ -15,6 +15,7 @@ _: let
postgres-server postgres-server
matrix-homeserver matrix-homeserver
vaultwarden-server vaultwarden-server
monitoring-server
irc-client irc-client
]); ]);

8
tf/kw-mon.tf Normal file
View file

@ -0,0 +1,8 @@
resource "cloudflare_record" "mon" {
name = "mon"
proxied = false
ttl = 3600
type = "CNAME"
value = "yukari.gensokyo.zone"
zone_id = local.zone_ids.kittywitch
}