-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprometheus.nix
74 lines (74 loc) · 1.73 KB
/
prometheus.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ config, lib, ... }:
let
tld = config.redbrick.tld;
# We Should be able to generate this
nodes = [
"albus"
"butlerxvm"
"daedalus"
"hardcase"
"icarus"
"m1cr0man"
"metharme"
"zeus"
];
globalConfig = {
scrape_interval = "15s";
evaluation_interval = "15s";
};
in {
services.prometheus = {
inherit globalConfig;
enable = true;
webExternalUrl = "https://prometheus.${tld}";
scrapeConfigs = [
{
job_name = "prometheus";
static_configs = [{ targets = ["localhost:9090"]; }];
}
{
job_name = "promtail";
static_configs = [{ targets = ["log.internal:9080"]; }];
}
{
job_name = "loki";
static_configs = [{ targets = ["log.internal:3100"]; }];
}
{
job_name = "postgres";
static_configs = [{ targets = ["localhost:9187"]; }];
}
{
job_name = "traefik";
static_configs = [{ targets = ["zeus.internal:8080"]; }];
}
{
job_name = "grafana";
static_configs = [{ targets = ["localhost:3001"]; }];
}
{
job_name = "gitea";
static_configs = [{ targets = ["localhost:3000"]; }];
}
{
job_name = "bind";
static_configs = [{ targets = ["m1cr0man.internal:9119"]; }];
}
{
job_name = "collectd";
static_configs = [{ targets = ["zeus.internal:9103"]; }];
}
{
# Only to be used with docker
job_name = "cadvisor";
static_configs = [{ targets = ["zeus.internal:8081"]; }];
}
{
job_name = "node-exporter";
static_configs = [{
targets = (map (node: "${node}.internal:9100") nodes);
}];
}
];
};
}