I find myself repeating very similar Prometheus queries in Grafana, with minor differences (mostly to the metric name). Is there a way to reuse these and supply the metric name as a parameter?
As an example, I have the following query:
label_replace(erlang_vm_ets_limit{instance=~"[^.]*${host}.*",env="${env}",app="${app}"}, "host", "$1", "instance", "[^.]*?(\\d+).*")
Now I want the same query for the metric erlang_vm_memory_ets_tables
(and many others). I'd love to be able to store the query somewhere with a parametrizable metric name, e.g. label_replace([[metric_name]]{instance=~"[^.]*${host}.*",env="${env}",app="${app}"}, "host", "$1", "instance", "[^.]*?(\\d+).*")
. Is something like that possible? Or is there another Grafana-native way to re-use parts of Prometheus queries?