Data links field variables after transformation

(Grafana version v9.0.6)

I have a Prometheus data source returning metrics with the “instance” label and the value is in the format of <host>:<port>. I used the “rename by regex” transformation (match (^.*):[0-9]+(.*$) and replace with $1$2) to remove the port part and it works fine. However, when I refer to the field variable ${__field.labels.instance} in the data link, it gives me the value with port number still.

Could you please advise what is the right way to achieve this?

1 Like