[metrics] enable on all microvms
This commit is contained in:
@@ -43,6 +43,7 @@ let
|
|||||||
|
|
||||||
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
||||||
inputs.microvm.nixosModules.microvm
|
inputs.microvm.nixosModules.microvm
|
||||||
|
self.nixosModules.malobeo.metrics
|
||||||
{
|
{
|
||||||
microvm = {
|
microvm = {
|
||||||
hypervisor = "cloud-hypervisor";
|
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;
|
systemd.network.enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -16,25 +16,7 @@ with lib;
|
|||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 9002 ];
|
networking.firewall.allowedTCPPorts = [ 9002 ];
|
||||||
|
|
||||||
services.prometheus = {
|
malobeo.metrics.logNginx = lib.mkForce true;
|
||||||
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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];
|
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];
|
||||||
|
|
||||||
|
|||||||
@@ -39,13 +39,6 @@ with lib;
|
|||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 9001;
|
port = 9001;
|
||||||
exporters = {
|
|
||||||
node = {
|
|
||||||
enable = true;
|
|
||||||
enabledCollectors = [ "systemd" "processes" ];
|
|
||||||
port = 9002;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
{
|
{
|
||||||
@@ -54,12 +47,25 @@ with lib;
|
|||||||
targets = [ "127.0.0.1:9002" ];
|
targets = [ "127.0.0.1:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "durruti";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "10.0.0.5:9002" ];
|
||||||
|
}];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
job_name = "infradocs";
|
job_name = "infradocs";
|
||||||
static_configs = [{
|
static_configs = [{
|
||||||
targets = [ "10.0.0.11:9002" ];
|
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;
|
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" ];
|
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user