deploy prometheus clan service

This commit is contained in:
2025-08-25 07:21:21 +02:00
parent a7d835cdee
commit 713c2c5b58
4 changed files with 39 additions and 26 deletions

View File

@@ -1,6 +1,5 @@
{ {
self, self,
config,
... ...
}: }:
{ {
@@ -48,29 +47,6 @@
efiInstallAsRemovable = true; efiInstallAsRemovable = true;
}; };
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "crocus";
static_configs = [
{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}
];
}
];
};
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true; recommendedProxySettings = true;

View File

@@ -8,12 +8,14 @@
deploy.targetHost = "root@crocus"; deploy.targetHost = "root@crocus";
tags = [ tags = [
"garage" "garage"
"server"
]; ];
}; };
genepi = { genepi = {
deploy.targetHost = "root@genepi"; deploy.targetHost = "root@genepi";
tags = [ tags = [
"garage" "garage"
"server"
]; ];
}; };
}; };
@@ -126,6 +128,41 @@
]; ];
roles.server.machines = { }; roles.server.machines = { };
}; };
prometheus = {
module.input = "self";
module.name = "@rpqt/prometheus";
roles.scraper.machines.genepi = { };
roles.scraper.settings = {
extraScrapeConfigs = [
{
job_name = "garage";
static_configs = [
{
labels.instance = "crocus";
targets = [ "crocus.home.rpqt.fr:3903" ];
}
{
labels.instance = "genepi";
targets = [ "genepi.home.rpqt.fr:3903" ];
}
];
}
];
};
roles.target.tags.server = { };
roles.target.settings = {
exporters = {
node = {
enabledCollectors = [
"systemd"
];
};
};
};
};
}; };
}; };
} }

View File

@@ -58,6 +58,4 @@ in
}; };
}; };
}; };
clan.core.state.userdata.folders = [ "/var/lib/prometheus2" ];
} }

View File

@@ -4,4 +4,6 @@
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
}; };
networking.firewall.interfaces."zts7mq7onf".allowedTCPPorts = [ 443 ];
} }