I am trying to get the cluster name with a variable in Grafana and I need it to be retrieved from the prometheus data source.
I tried with label_values(kube_pod_info, cluster)
and label_values(up, cluster)
but it's not working for me
Any ideas how to achieve this?
You need to have a "cluster" label defined in the "kube_pod_info" metric.
To resolve this you can just use the "instance" label instead or create a "cluster" label in the Prometheus configuration using the "instance" label to map the IPs to known cluster names, for example.