switch from netdata to grafana

This commit is contained in:
Noah Masur 2022-10-14 04:01:41 +00:00
parent a17a048d9d
commit 595eac9367
3 changed files with 32 additions and 1 deletions

View File

@ -77,7 +77,7 @@ nixpkgs.lib.nixosSystem {
../../modules/services/jellyfin.nix
../../modules/services/nextcloud.nix
../../modules/services/transmission.nix
../../modules/services/metrics.nix
../../modules/services/prometheus.nix
../../modules/gaming/minecraft-server.nix
];
}

View File

@ -0,0 +1,31 @@
{ config, pkgs, lib, ... }: {
options.metricsServer = lib.mkOption {
type = lib.types.str;
description = "Hostname of the Grafana server.";
default = "grafana.masu.rs";
};
config = {
services.grafana.enable = true;
services.prometheus = {
enable = true;
exporters.node.enable = true;
scrapeConfigs = [{
job_name = "local";
static_configs = [{ targets = [ "127.0.0.1:9100" ]; }];
}];
};
caddyRoutes = [{
match = [{ host = [ config.metricsServer ]; }];
handle = [{
handler = "reverse_proxy";
upstreams = [{ dial = "localhost:3000"; }];
}];
}];
};
}