From 09d068578357a4fab865b1d56dcf4b0f2c352a6d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 1 Jan 2022 23:58:40 +0100 Subject: vidhar: loki --- hosts/vidhar/default.nix | 30 ++++++++++++++++++++++++++++++ hosts/vidhar/zfs.nix | 6 ++++++ 2 files changed, 36 insertions(+) (limited to 'hosts') diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 0bb1f680..6002947f 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix @@ -155,5 +155,35 @@ sopsFile = ./grafana-secret-key; owner = "grafana"; }; + + services.loki = { + enable = true; + configuration = { + auth_enabled = false; + server = { + http_listen_port = 9094; + grpc_listen_port = 9095; + }; + }; + }; + services.promtail = { + enable = true; + configuration = { + server = { + http_listen_port = 9080; + grpc_listen_port = 0; + }; + clients = [ + { url = "http://localhost:9094/loki/api/v1/push"; } + ]; + scrape_configs = [ + { job_name = "system"; + journal = { + json = true; + }; + } + ]; + }; + }; }; } diff --git a/hosts/vidhar/zfs.nix b/hosts/vidhar/zfs.nix index 53ba5120..8c164bbd 100644 --- a/hosts/vidhar/zfs.nix +++ b/hosts/vidhar/zfs.nix @@ -89,6 +89,12 @@ in { options = [ "zfsutil" ]; }; + "/var/lib/loki" = + { device = "ssd-raid1/local/var-lib-loki"; + fsType = "zfs"; + options = [ "zfsutil" ]; + }; + "/var/log" = { device = "ssd-raid1/local/var-log"; fsType = "zfs"; -- cgit v1.2.3