deploy prometheus clan service
This commit is contained in:
parent
a7d835cdee
commit
713c2c5b58
4 changed files with 39 additions and 26 deletions
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
|
@ -48,29 +47,6 @@
|
|||
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 = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
|
|
|
|||
|
|
@ -8,12 +8,14 @@
|
|||
deploy.targetHost = "root@crocus";
|
||||
tags = [
|
||||
"garage"
|
||||
"server"
|
||||
];
|
||||
};
|
||||
genepi = {
|
||||
deploy.targetHost = "root@genepi";
|
||||
tags = [
|
||||
"garage"
|
||||
"server"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
@ -126,6 +128,41 @@
|
|||
];
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,4 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
clan.core.state.userdata.folders = [ "/var/lib/prometheus2" ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,6 @@
|
|||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
};
|
||||
|
||||
networking.firewall.interfaces."zts7mq7onf".allowedTCPPorts = [ 443 ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue