We have promql expressions like this on virtually all our graphs
label_replace(x, "instance", "$1", "instance", "([^.]+).*")
We do this so we can have the hostname in the legend without the fqdn and port appearing which is entirely redundant for these metrics since they’re always coming from the same service within a cluster.
It really clutters up our promql metrics and make it a real pain to copy the metrics around. It seems like it this is really a display formatting issue and would be better handled in the legend format string, something like:
Better yet would be to be able to define this as a common expression in the dashboard config and then just use
host as if it was a label without having to put this on every legend field.
Is anything like this possible today or is this a feature request?