So I am trying to add the Kubernetes node name to my static_config scrape using relabel_configs, but these don’t get added for some reason. I think I’m either doing something wrong or missing the point of relabelling. Here’s a manifest that can reproduce this -
The indentation is only an issue on this forum. I have verified correct yaml indentation locally. I’m unable to run dry-run but I’ve ssh’d onto a pod and here are the contents of /etc/promtail/promtail.yaml -
I did a little more digging and looking at the service discovery you can see that the promtail job exists, as do the kubernetes_sd_config labels. However, for some reason the $1 is being evaluated to null. If I change replacement: $1 to replacement: foo-$1, I see the syslog job with the node_name: foo- label. Any idea whats going on?
I am having the same issue, did you find any solution for this?
With the same config, I cant seem to find the kubernetes labels in Discovered labels section