This commit is contained in:
Kopatz
2024-04-14 17:57:09 +02:00
parent b00533bf64
commit c14539cbe3
2 changed files with 69 additions and 0 deletions

View File

@@ -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";
}
];
}
];
};
};
}

View File

@@ -0,0 +1,29 @@
# This is a complete configuration to deploy Loki backed by the filesystem.
# The index will be shipped to the storage via tsdb-shipper.
auth_enabled: false
server:
http_listen_port: 3100
common:
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
replication_factor: 1
path_prefix: /mnt/250ssd/loki/common
schema_config:
configs:
- from: 2020-05-15
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
analytics:
reporting_enabled: false