From 9187555785715c583e8d66f6f5f394b4e8455d4a Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 14 Sep 2024 20:45:30 +0530 Subject: [PATCH] rico0: push caddy logs to loki --- hosts/shared/promtail.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hosts/shared/promtail.nix b/hosts/shared/promtail.nix index 63cdaf3..592ce54 100644 --- a/hosts/shared/promtail.nix +++ b/hosts/shared/promtail.nix @@ -15,6 +15,29 @@ ]; positions = { filename = "/tmp/promtail-positions.yaml"; }; scrape_configs = [ + { + job_name = "caddy"; + static_configs = [ + { + targets = [ "localhost" ]; + labels = { + job = "caddy"; + "__path__" = "/var/log/caddy/*log"; + agent = "caddy-promtail"; + }; + } + ]; + pipeline_stages = [ + { + json = { + expressions = { duration = "duration"; status = "status"; }; + }; + } + { + labels = { duration = ""; status = ""; }; + } + ]; + } { job_name = "journal"; journal = {