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

@ -24,6 +24,26 @@ in {
type = types.str;
};
};
ip = mkOption {
type = types.str;
default = cfg.host.ip;
};
port = mkOption {
type = types.port;
default = port;
};
datasource = {
name = mkOption {
type = types.str;
};
url = mkOption {
type = types.str;
};
};
};
config = mkIf cfg.enable {
@ -44,6 +64,18 @@ in {
domain = "${name}.skynet.ie";
port = port;
addr = cfg.host.ip;
provision = {
enable = true;
datasources.settings.datasources = [
{
name = cfg.datasource.name;
type = "Prometheus";
url = cfg.datasource.url;
isDefault = true;
}
];
};
};
services.nginx.virtualHosts = {