mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
every gets a little promtail
This commit is contained in:
parent
1e37277c31
commit
4759ef2a03
2 changed files with 39 additions and 36 deletions
|
|
@ -22,13 +22,6 @@
|
|||
boot.tmp.cleanOnBoot = true;
|
||||
zramSwap.enable = true;
|
||||
|
||||
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 9100 ];
|
||||
services.prometheus.exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
|
|
@ -41,4 +34,42 @@
|
|||
enable = true;
|
||||
};
|
||||
system.nixos.distroName = "NixOS (gay 🏳️⚧️)";
|
||||
|
||||
# monitoring
|
||||
|
||||
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 9100 ];
|
||||
services.prometheus.exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
disable = true;
|
||||
};
|
||||
clients = [
|
||||
{
|
||||
url = "http://vps3.local:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
node = name;
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "unit";
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
networking.firewall.interfaces.wg0.allowedTCPPorts = [ 3100 ]; # loki
|
||||
age.secrets.loki_env.file = ../../secrets/loki_env.age;
|
||||
systemd.services.loki.serviceConfig.EnvironmentFile = config.age.secrets.loki_env.path;
|
||||
services.loki = {
|
||||
|
|
@ -141,33 +142,4 @@
|
|||
mkdir -p /var/lib/loki/{index,cache}
|
||||
chown ${config.services.loki.user}:${config.services.loki.group} -R /var/lib/loki
|
||||
'';
|
||||
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
disable = true;
|
||||
};
|
||||
clients = [
|
||||
{
|
||||
url = "http://localhost:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "12h";
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
};
|
||||
};
|
||||
relabel_configs = [{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "unit";
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue