create grafana and prometheus setup
This commit is contained in:
parent
d03f4c6fb1
commit
9327314ec9
23
modules/monitoring.nix
Normal file
23
modules/monitoring.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
domain = "monitoring.${config.networking.domain}";
|
||||
in {
|
||||
# grafana configuration
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
port = 2342;
|
||||
};
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
};
|
||||
|
||||
# nginx reverse proxy
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.grafana.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue