Using the label_replace function in PromQL
do something like the following:
label_replace(up, "short_hostname", "$1", "instance", "(.+):(\\d+)")
Then put {{short_hostname}} in the legend field in Grafana
- Read more about Using the label_replace function in PromQL
- Log in or register to post comments