odin: Enable prometheus node exporter and promtail

This commit is contained in:
Erwin Boskma 2024-04-26 11:58:54 +02:00
parent 721e35fde9
commit 8d4f5cdb2d
Signed by: erwin
SSH key fingerprint: SHA256:OCinH/khuGY1LA9RG8YLM8GNH6C1DDXBdy3SNE+I5Hw
2 changed files with 40 additions and 0 deletions

View file

@ -15,6 +15,7 @@
./storage.nix
./network.nix
./virtualisation.nix
./promtail
../../users/erwin
../../users/root
];
@ -105,6 +106,12 @@
lvm = {
enable = true;
};
prometheus.exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
};
};
};
system.stateVersion = "24.05";

View file

@ -0,0 +1,33 @@
{
services.promtail = {
enable = true;
configuration = {
clients = [ { url = "http://saga:3100/loki/api/v1/push"; } ];
positions = {
filename = "/tmp/positions.yaml";
};
scrape_configs = [
{
job_name = "journal";
journal = {
labels = {
host = "odin";
job = "systemd-journal";
};
max_age = "12h";
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}
];
}
];
server = {
grpc_listen_port = 0;
http_listen_port = 28183;
};
};
};
}