Add promtail for journal
Some checks failed
Run nix flake check / flake-check (push) Failing after 7m47s

This commit is contained in:
Torjus Håkestad 2024-12-01 03:00:07 +01:00
parent 8700e78752
commit 32425807fc
Signed by: torjus
SSH Key Fingerprint: SHA256:KjAds8wHfD2mBYK2H815s/+ABcSdcIHUndwHEdSxml4
4 changed files with 45 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./monitoring.nix ./monitoring
./packages.nix ./packages.nix
./root-user.nix ./root-user.nix
./root-ca.nix ./root-ca.nix

View File

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./metrics.nix
./logs.nix
];
}

View File

@ -0,0 +1,37 @@
{ ... }:
{
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_address = "0.0.0.0";
http_listen_port = 9099;
};
clients = [
{
url = "http://monitoring01.home.2rjus.net:3100/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
json = true;
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "systemd_unit";
}
{
source_labels = [ "__journal__hostname" ];
target_label = "host";
}
];
}
];
};
};
}