grafana / alloy-modules

Apache License 2.0
21 stars 11 forks source link

fix: target kubernetes mirror pod logs #52

Open adamhackl opened 1 week ago

adamhackl commented 1 week ago

Kubernetes mirror pods (kube-apiserver, kube-controller-manager, kube-scheduler, kube-vip, etcd) don't use the same directory pattern for their log files. Regular kubernetes pods work with the structure /var/log/pods/*<pod uid>/<container name>/*.log, but mirror pods use the mirror hash in place of the pod uid. This fix should use the mirror hash if the annotation is available, otherwise it uses the pod uid.