revert hostname label
This commit is contained in:
@@ -31,6 +31,12 @@ loki.process "parse_hostname" {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback: Set hostname explicitly if not parsed
|
||||
stage.static_labels {
|
||||
values = {
|
||||
hostname_fallback = system.hostname, // e.g., fm002
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Refine labels
|
||||
@@ -50,11 +56,11 @@ loki.relabel "add_labels" {
|
||||
source_labels = ["hostname"]
|
||||
target_label = "hostname"
|
||||
}
|
||||
//rule {
|
||||
// source_labels = ["hostname_fallback"]
|
||||
// target_label = "hostname"
|
||||
// action = "replace"
|
||||
// replacement = "${__label:hostname_fallback}" // Only if hostname is unset
|
||||
rule {
|
||||
source_labels = ["hostname_fallback"]
|
||||
target_label = "hostname"
|
||||
action = "replace"
|
||||
replacement = "${__label:hostname_fallback}" // Only if hostname is unset
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user