-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitoring.nix
40 lines (37 loc) · 907 Bytes
/
monitoring.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ config, ... }: {
services = {
grafana = {
enable = true;
settings.server = {
domain = "monitoring.liv.town";
http_addr = "127.0.0.1";
http_port = 2342;
};
};
nginx.virtualHosts.${config.services.grafana.domain} = {
useACMEHost = "liv.town";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
proxyWebsockets = true;
};
};
prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
scrapeConfigs = [{
job_name = "violet";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}];
}];
};
};
}