From 86b0e99a864866fa080e2c2975681ad681682628 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Tue, 11 Mar 2025 14:36:00 +0100 Subject: [PATCH] add hostname label --- templates/config.alloy.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/config.alloy.erb b/templates/config.alloy.erb index d7fc811..76399f2 100644 --- a/templates/config.alloy.erb +++ b/templates/config.alloy.erb @@ -25,7 +25,11 @@ loki.relabel "add_labels" { source_labels = ["__host__"] target_label = "hostname" } - + rule { + action = "replace" + target_label = "hostname" + replacement = "${env.HOSTNAME}" + } rule { action = "replace" target_label = "job"