I have a Prometheus server gathering metrics from several software installations. Each installation applies labels "Customer" & "System" to all metrics in the Prometheus relabel phase, and I have a Grafana dashboard which uses template variables $Customer, $System so my dashboard shows graphs for a single customer-system.
e.g. I can choose "Google/Test" or "Microsoft/Live" combinations.
This means all my queries are like my_counter_total{Customer='$Customer', System='$System'} which is rather tiring. Is there anyway to apply {Customer='$Customer', System='$System'} at dashboard level to all queries? The Grafana documentation hints it can be done but doesn't say how, and I cannot find a single example.
edit: As noted 'ad hoc queries' seem to be able to do this but the entire documentation is:
Ad hoc filters are one of the most complex and flexible variable options available. Instead of a regular list of variable options, this variable allows you to build a dashboard-wide ad hoc query. Filters you apply in this manner are applied to all panels on the dashboard.
So they tell me it's very complicated and leave me hanging :)


