2024-07-21 19:10:11 +05:30
|
|
|
{ config, ... }: {
|
|
|
|
services = {
|
|
|
|
promtail = {
|
|
|
|
enable = true;
|
|
|
|
configuration = {
|
|
|
|
server = {
|
|
|
|
http_listen_address = "127.0.0.1";
|
|
|
|
http_listen_port = 9080;
|
2024-07-27 17:33:39 +05:30
|
|
|
grpc_listen_port = 0;
|
2024-07-21 19:10:11 +05:30
|
|
|
};
|
|
|
|
clients = [
|
|
|
|
{
|
2024-07-27 17:33:39 +05:30
|
|
|
url = "https://loki.labs.adtya.xyz/loki/api/v1/push";
|
2024-07-21 19:10:11 +05:30
|
|
|
}
|
|
|
|
];
|
|
|
|
positions = { filename = "/tmp/promtail-positions.yaml"; };
|
|
|
|
scrape_configs = [
|
|
|
|
{
|
|
|
|
job_name = "journal";
|
|
|
|
journal = {
|
|
|
|
json = false;
|
|
|
|
max_age = "12h";
|
|
|
|
path = "/var/log/journal";
|
|
|
|
labels = { job = "systemd-journal"; host = "${config.networking.hostName}"; };
|
|
|
|
};
|
2024-07-21 19:19:02 +05:30
|
|
|
relabel_configs = [
|
2024-07-21 19:10:11 +05:30
|
|
|
{
|
|
|
|
source_labels = [ "__journal__systemd_unit" ];
|
|
|
|
target_label = "unit";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|