Skip to content

Commit

Permalink
fix: use mirror pod hash over pod uid if its present
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhackl committed Jan 8, 2025
1 parent 32aeea4 commit ea7ae6f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/kubernetes/core/logs.alloy
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ declare "from_worker" {
// DO NOT delete this line as it is needed to tail the pod logs on the node
rule {
action = "replace"
separator = "/"
separator = ";"
source_labels = [
"__meta_kubernetes_pod_annotation_kubernetes_io_config_mirror",
"__meta_kubernetes_pod_uid",
"__meta_kubernetes_pod_container_name",
]
replacement = "/var/log/pods/*$1/*.log"
regex = "^(?:([a-f0-9]{32});.*|;([a-f0-9\\-]+));(.+)$"
replacement = "/var/log/pods/*$1$2/$3/*.log"
target_label = "__path__"
}

Expand Down

0 comments on commit ea7ae6f

Please sign in to comment.