I want to pass kubernetes cluster name thru environment variables to Promtail agent as an extra label. Any suggestions?
This is how my config looks like
- source_labels:
- __env_CLUSTER_NAME
target_label: cluster_name
but I still can not see the cluster_name label.
I set the cluster name as an ENV variable and use it in my Promtail config to set external_labels
on my client
.
clients:
- basic_auth:
password: ${LOKI_BASIC_AUTH_PW}
username: ${LOKI_BASIC_AUTH_USER}
external_labels:
cluster: ${CLUSTER}
url: ${LOKI_URL}