Grafana - template variable lookups

Quick question for anyone who is well versed with template variables. I have a Prometheus query that is being visualized in a table. I need to use a label in the timeseries to map to another piece of metadata that does not exist in another timeseries (mapping VM instances identifiers to an identifier that my sales guys understand). Basically, I’d use label_replace to insert the new label. Any suggestions on where to look to or if a template variable lookup based on a label value is even doable?

How about Variables at a dashboard level?

That is rather where I’m hoping to put the mapping, yes. Basically, a look-up table. Something like this:

foo_var: {
           "foo": "bar",
           "bar": "baz"
          }

# Query
label_replace(metric_name, "new_label", "${foo_var[$1]}", "foobar", "(.*)")

# Result
metric_name{foobar="bar", new_label="baz"} 1```

You could define a static list of values for a options variable at a Dashboard Level AFAIK.

Problem solved, I guess?

Likely, yes. I’ll have to give that a go. Thanks!

You bet, do lemme know how it goes since I can also adopt the same approach for the dashboards that I build, going forward.