Add foureighty logs

This commit is contained in:
Cyryl Płotnicki 2020-11-21 15:29:50 +00:00
parent c3ea8dad68
commit e8ff36a1ec
2 changed files with 29 additions and 3 deletions

View file

@ -1,8 +1,14 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
virtualisation.oci-containers.containers.meditate = { systemd.services.promtail = {
image = "meditate"; description = "Promtail service for Loki";
ports = [ "80:80" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.grafana-loki}/bin/promtail --config.file ${./promtail.yaml}
'';
};
}; };
services = { services = {

20
nixos/promtail.yaml Normal file
View file

@ -0,0 +1,20 @@
server:
http_listen_port: 28183
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://vultr1.local:3100/loki/api/v1/push
scrape_configs:
- job_name: journal
journal:
max_age: 12h
labels:
job: systemd-journal
host: foureighty
relabel_configs:
- source_labels: ["__journal__systemd_unit"]
target_label: "unit"