blob: 94319b5c6886ee846c68212f84c13a8df6a05b03 (
plain)
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
40
41
42
|
inputs:
{ config, ... }:
{
services.prometheus = {
enable = true;
listenAddress = "127.0.0.1";
retentionTime = "15w";
scrapeConfigs = [
{
job_name = "prometheus";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.port}" ]; }
];
}
{
job_name = "grafana";
static_configs = [
{ targets = [ "localhost:${toString config.services.grafana.port}" ]; }
];
}
];
};
services.grafana = {
enable = true;
addr = config.topology.mainVpn.currentNodeIP;
port = 3001;
analytics.reporting.enable = false;
};
networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [
config.services.grafana.port
];
}
|