On 26/11/2021 15:56, Mohammad Khoschnasar wrote:
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
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/13be2743-4086-1c69-712f-16ce7c592b52%40Jahingo.com.