mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 15:00:14 +00:00
switch from netdata to grafana
This commit is contained in:
31
modules/services/prometheus.nix
Normal file
31
modules/services/prometheus.nix
Normal 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"; }];
|
||||
}];
|
||||
}];
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user