odin: Enable prometheus node exporter and promtail
This commit is contained in:
parent
721e35fde9
commit
8d4f5cdb2d
2 changed files with 40 additions and 0 deletions
|
@ -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";
|
||||
|
|
33
machines/odin/promtail/default.nix
Normal file
33
machines/odin/promtail/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue