Add hostname as label
All checks were successful
ShellCheck / shellcheck (push) Successful in 38s

This commit is contained in:
Mathieu Strypsteen 2024-09-01 16:21:24 +02:00
parent 3d7d552492
commit f01c7cbfdf
Signed by: mathieu
GPG key ID: 782A42E461BC6824
2 changed files with 5 additions and 0 deletions

View file

@ -1,3 +1,6 @@
logging {
level = "warn"
}
prometheus.exporter.unix "local" {
rootfs_path = "/run/host"
enable_collectors = ["systemd"]
@ -18,6 +21,7 @@ prometheus.remote_write "writer" {
}
loki.source.journal "journald" {
path = "/run/host/var/log/journal"
labels = {host = constants.hostname}
relabel_rules = loki.relabel.journald.rules
forward_to = [loki.write.writer.receiver]
}

View file

@ -4,6 +4,7 @@ PodmanArgs=--pid=host
UserNS=host
Unmask=ALL
Network=host
Exec=run /etc/alloy/config.alloy --storage.path=/var/lib/alloy/data --disable-reporting
Volume=/var/lib/system-config/container-config/alloy/config.alloy:/etc/alloy/config.alloy:z,ro
Volume=alloy.volume:/var/lib/alloy/data:U,Z
Volume=/:/run/host:ro