I have ":9100" showing up at the end of my metrics. I am using a prometheus datasource with my company and can't change it. Has anyone figured out how to remove this? I was thinking maybe templates or regex but I haven't been successful yet.
Configuration:
Legend Format = {{hostname}}
Result = myhostname.mydomain.com:9100
As far as I know, currently it is not possible to format the legend in Grafana (there is an open PR for it), however as you are using Prometheus, you can use its label_replace()
function, eg.:
label_replace(my_vector, "short_hostname", "$1", "hostname", "(.*):.*")
This should give you:
Legend Format = {{short_hostname}}
Result = myhostname.mydomain.com