Get loki, prometheus, and promtail configured

First iteration
This commit is contained in:
Alejandro Angulo 2023-09-07 22:51:38 -07:00
parent f15e36d635
commit e3a54876ec
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
4 changed files with 228 additions and 1 deletions

View file

@ -7,6 +7,7 @@
}:
with lib; let
cfg = config.aa.services.prometheus;
exporters = config.services.prometheus.exporters;
in {
options.aa.services.prometheus = with types; {
enable = mkEnableOption "prometheus";
@ -21,7 +22,26 @@ in {
};
config = mkIf cfg.enable {
services.prometheus.enable = true;
services.prometheus = {
enable = true;
exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "foo";
static_configs = [
{
targets = ["127.0.0.1:${toString exporters.node.port}"];
}
];
}
];
};
services.nginx = {
enable = true;