
The picture is the variable page in Grafana dashboard's setting.
So I thought instead of changing the queries in each panel of the dashboard, I'll change the variable for the whole dashboard.
Let me explain again.I have two Traefik instances. The metrics of those two are going to one prometheus instance. In prometheus.yml, I have defined two jobs under the scrape_config and now in grafana I want to separate the services that coming from Traefik-A from the services coming from Traefik-B. What is the best way to do that?Going in each panel and change the query is not efficient I think. That's why I decided to change the main varibale in dashboard setting.
So there are a few things I'd suggest doing:
1. Change your prometheus.yaml to only have one job, but listing both Traefik instances
2. Add a Grafana variable with "label_values(metric,
label)", where metric is the name of one of the Traefik metrics
and label = instance
3. Make sure each of the queries within your dashboard have
job='<job>',instance=$<variable> (where job is the
name of the job in prometheus.yaml & variable is whatever
you called the Grafana variable).
-- Stuart Clark