nixos-servers/system/monitoring/logs.nix
Torjus Håkestad e366a05204
Some checks failed
Run nix flake check / flake-check (push) Failing after 9m1s
Periodic flake update / flake-update (push) Successful in 1m30s
Fix caddy logging
2025-01-28 00:49:22 +01:00

56 lines
1.2 KiB
Nix

{ config, ... }:
{
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_address = "0.0.0.0";
http_listen_port = 9099;
grpc_listen_address = "0.0.0.0";
grpc_listen_port = 9098;
};
clients = [
{
url = "http://monitoring01.home.2rjus.net:3100/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
json = true;
labels = {
job = "systemd-journal";
};
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "systemd_unit";
}
{
source_labels = [ "__journal__hostname" ];
target_label = "host";
}
];
}
{
job_name = "varlog";
static_configs = [
{
targets = [ "localhost" ];
labels = {
job = "varlog";
__path__ = "/var/log/**/*.log";
hostname = "${config.networking.hostName}";
};
}
];
}
];
};
};
}