Replace telegraf with node exporter

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-04-19 17:57:34 +03:00
parent 3f1531fbd1
commit 1a445ab6fd
37 changed files with 3099 additions and 421 deletions

View File

@@ -71,6 +71,8 @@ in
enable-signup = false;
enable-login = true;
enable-reservations = false;
metrics-listen-http = ":9090";
}
);
@@ -111,26 +113,54 @@ in
volumes.ntfy = { };
containers.ntfy = {
containerConfig = {
image = "docker-archive:${selfPkgs.docker-ntfy}";
networks = [
networks.ntfy.ref
networks.traefik.ref
];
volumes = [
"${volumes.ntfy.ref}:/var/lib/ntfy"
"${hmConfig.sops.templates."ntfy-server.yml".path}:/etc/ntfy/server.yml:ro"
"${hmConfig.sops.templates."ntfy-init.sh".path}:/entrypoint.sh:ro"
];
entrypoint = "/entrypoint.sh";
labels = [
"traefik.enable=true"
"traefik.http.routers.ntfy.rule=Host(`ntfy.karaolidis.com`)"
];
containers = {
ntfy = {
containerConfig = {
image = "docker-archive:${selfPkgs.docker-ntfy}";
networks = [
networks.ntfy.ref
networks.traefik.ref
networks.prometheus.ref
];
volumes = [
"${volumes.ntfy.ref}:/var/lib/ntfy"
"${hmConfig.sops.templates."ntfy-server.yml".path}:/etc/ntfy/server.yml:ro"
"${hmConfig.sops.templates."ntfy-init.sh".path}:/entrypoint.sh:ro"
];
entrypoint = "/entrypoint.sh";
labels = [
"traefik.enable=true"
"traefik.http.routers.ntfy.rule=Host(`ntfy.karaolidis.com`)"
];
};
unitConfig.After = [ "sops-nix.service" ];
};
unitConfig.After = [ "sops-nix.service" ];
prometheus-init.containerConfig.volumes =
let
ntfyConfig = (pkgs.formats.yaml { }).generate "ntfy.yml" {
scrape_configs =
let
hostname = config.networking.hostName;
in
[
{
job_name = "${hostname}-ntfy";
static_configs = [
{
targets = [ "ntfy:9090" ];
labels = {
app = "ntfy.sh";
inherit user hostname;
};
}
];
}
];
};
in
[ "${ntfyConfig}:/etc/prometheus/conf.d/ntfy.yml" ];
};
};
};