This commit is contained in:
iFargle 2023-06-30 17:59:07 +09:00
parent 3a44709859
commit 567ff8902c

View file

@ -11,64 +11,34 @@
services.promtail = { services.promtail = {
enable = true; enable = true;
configuration = { configuration = {
{ server = {
"positions": { http_listen_port = 3031;
"filename": "/tmp/positions.yaml" grpc_listen_port = 0;
}, };
"clients": [ positions = {
{ filename = "/tmp/positions.yaml";
"url": "https://loki.sysctl.io/loki/api/v1/push", };
"basic_auth": { clients = [{
"username": "loki-sa", url = "https://loki.sysctl.io/loki/api/v1/push";
"password": https://nixos.wiki/wiki/Comparison_of_secret_managing_schemes basic_auth = {
} username = loki-sa;
} password = null; # https://nixos.wiki/wiki/Comparison_of_secret_managing_schemes;
], }
"scrape_configs": [ }];
{ scrape_configs = [{
"job_name": "system", job_name = "journal";
"static_configs": [ journal = {
{ max_age = "12h";
"targets": [ labels = {
"localhost" job = "systemd-journal";
], host = "nixos-p1";
"labels": { };
"job": "varlogs", };
"__path__": "/host/var/log/*.log" relabel_configs = [{
} source_labels = [ "__journal__systemd_unit" ];
} target_label = "unit";
], }];
"pipeline_stages": [ }];
{
"static_labels": {
"host": "nixos-p1"
}
}
]
},
{
"job_name": "secure",
"static_configs": [
{
"targets": [
"localhost"
],
"labels": {
"job": "varlogs",
"__path__": "/host/var/log/secure"
}
}
],
"pipeline_stages": [
{
"static_labels": {
"host": "nixos-p1"
}
}
]
}
]
}
}; };
}; };
} }