[metrics] enable on all microvms
All checks were successful
Check flake syntax / flake-check (push) Successful in 4m9s

This commit is contained in:
2025-01-20 21:29:25 +01:00
parent 725efc3e0a
commit 7730163b84
3 changed files with 22 additions and 36 deletions

View File

@@ -43,6 +43,7 @@ let
defaultModules = baseModules;
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
self.nixosModules.malobeo.metrics
{
microvm = {
hypervisor = "cloud-hypervisor";
@@ -79,6 +80,13 @@ let
}
];
};
malobeo.metrics = {
enable = true;
enablePromtail = true;
logNginx = false;
lokiHost = "10.0.0.14";
};
systemd.network.enable = true;

View File

@@ -16,25 +16,7 @@ with lib;
networking.firewall.allowedTCPPorts = [ 9002 ];
services.prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" "processes" ];
port = 9002;
};
};
};
services.promtail = {
enable = true;
configFile = import ../modules/malobeo/promtail_config.nix {
lokiAddress = "10.0.0.14";
logNginx = true;
config = config;
pkgs = pkgs;
};
};
malobeo.metrics.logNginx = lib.mkForce true;
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];

View File

@@ -39,13 +39,6 @@ with lib;
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" "processes" ];
port = 9002;
};
};
scrapeConfigs = [
{
@@ -54,12 +47,25 @@ with lib;
targets = [ "127.0.0.1:9002" ];
}];
}
{
job_name = "durruti";
static_configs = [{
targets = [ "10.0.0.5:9002" ];
}];
}
{
job_name = "infradocs";
static_configs = [{
targets = [ "10.0.0.11:9002" ];
}];
}
{
job_name = "nextcloud";
static_configs = [{
targets = [ "10.0.0.13:9002" ];
}];
}
# add vpn - check how to reach it first. most probably 10.100.0.1
];
};
@@ -68,16 +74,6 @@ with lib;
configFile = ./loki.yaml;
};
services.promtail = {
enable = true;
configFile = import ../modules/malobeo/promtail_config.nix {
lokiAddress = "10.0.0.13";
logNginx = false;
config = config;
pkgs = pkgs;
};
};
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];