add loki
This commit is contained in:
@@ -87,4 +87,44 @@ in
|
||||
# metrics-addr = "127.0.0.1:9323";
|
||||
# experimental = true;
|
||||
#};
|
||||
|
||||
# Logs
|
||||
services.loki = {
|
||||
enable = true;
|
||||
dataDir = "/mnt/250ssd/loki";
|
||||
configFile = ./grafana/loki.yml;
|
||||
};
|
||||
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 28183;
|
||||
grpc_listen_port = 0;
|
||||
log_level = "warn";
|
||||
};
|
||||
positions.filename = "/tmp/positions.yaml";
|
||||
clients = [
|
||||
{ url = "http://127.0.0.1:3100/loki/api/v1/push"; }
|
||||
];
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "journal";
|
||||
journal = {
|
||||
max_age = "24h";
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
host = "127.0.0.1";
|
||||
};
|
||||
};
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "unit";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user