alloy: bare-metal systemd shipper for journald → Loki

Meridian + LiteLLM both run as systemd services on this LXC (no docker)
so the Docker-container Alloy pattern from other repos doesn't apply.
Apt-install grafana/alloy via apt.grafana.com, journald-only scrape,
ships to Loki on observe.lan.balders.ca.

Side benefit: Meridian.service + LiteLLM.service logs (including the
gpt-* alias shadowing requests from paperless-ai) now searchable in
Loki, not just journalctl on the LXC.
This commit is contained in:
Your Name
2026-05-19 22:49:44 -04:00
parent 49c6e10574
commit 03d1d4630f
5 changed files with 115 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
// Alloy — journald-only on this host (no Docker — Meridian + LiteLLM run
// as systemd services). Ships to Loki on observe.lan.balders.ca.
loki.source.journal "host" {
path = "/var/log/journal"
max_age = "12h"
forward_to = [loki.process.journal.receiver]
relabel_rules = loki.relabel.journal.rules
labels = {
job = "journald",
host = "{{ alloy_host_label }}",
}
}
loki.relabel "journal" {
forward_to = []
rule {
source_labels = ["__journal__systemd_unit"]
target_label = "unit"
}
rule {
source_labels = ["__journal__hostname"]
target_label = "instance"
}
rule {
source_labels = ["__journal_priority_keyword"]
target_label = "severity"
}
}
loki.process "journal" {
forward_to = [loki.write.default.receiver]
}
loki.write "default" {
endpoint {
url = "{{ alloy_loki_url }}"
}
}