Initial prometheus config

Also did provision config for grafana, could be done directly but went
through skynet.grafana config
This commit is contained in:
daragh 2024-05-21 06:16:35 +01:00
parent 50abdb90ab
commit 183f5a0e7d
No known key found for this signature in database
4 changed files with 137 additions and 0 deletions

View file

@ -29,6 +29,10 @@ in {
# every server will need the config to backup to
../applications/restic.nix
# every server will be monitored for grafana
../applications/prometheus.nix
#TODO: make sure no additional config needed for exporters ?
];
options.skynet = {

View file

@ -10,6 +10,7 @@ Notes:
*/
{
pkgs,
config,
lib,
nodes,
...
@ -26,6 +27,7 @@ Notes:
in {
imports = [
../applications/grafana.nix
../applications/prometheus.nix
];
deployment = {
@ -50,6 +52,32 @@ in {
sudo_groups = groups;
};
services.skynet.prometheus.server = {
host = {
ip = ip_pub;
name = name;
};
port = 9001;
servers = [
"agentjones"
"cadie"
"earth"
"galatea"
"gir"
"glados"
"kitt"
"marvin"
"neuromancer"
"optimus"
"skynet"
"vendetta"
"vigil"
"wheatly"
];
};
services.skynet.grafana = {
enable = true;
@ -57,6 +85,12 @@ in {
ip = ip_pub;
name = name;
};
# maybe just do provision config directly ?
datasource = {
name = "Prometheus";
url = "localhost:${toString config.services.prometheus.port}";
};
};
skynet_dns.records = [