Is there any way to do variables + default filters?

I love the Variables feature for offering very flexible customization options for each dashboard - but the annoying part is that I have to retype {var1=~"$var1", var2=~"$var", var=~"$var3"} dozens of times in each of the dashboard’s queries. It’s hard to make updates to the variable names or meanings, and the filters make the queries hard to read.

I also love the ad-hoc filters feature for applying to every query on the dashboard automatically, so I don’t have to do all that typing & query maintenance. But they have very little customization options, no way (as far as I can tell) restrict the possible inputs, or make them dependent on another filter’s selection, like I can with label_values(metricName{var1=~"$var1"}, var2).

Is there any way to get the best of both worlds? I’m thinking a “default filter” string that I could set to {var1=~"$var1", var2=~"$var", var=~"$var3"} and have that apply to all queries on the dashboard.

(In case it’s not clear, I’m using a Prometheus data source.)

Thanks!

This topic was automatically closed after 365 days. New replies are no longer allowed.