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.
On Friday, November 26, 2021 at 4:46:17 PM UTC+1 Stuart Clark wrote:

> So if you have two instances of the same application you'd normally only 
> have a single job with two instances listed.
>
> What are you trying to do in Grafana? That looks a bit like the variables 
> page rather than a panel in the dashboard. 
>
> On 26 November 2021 14:56:35 GMT, Mohammad Khoschnasar <
> [email protected]> wrote:
>>
>> Sorry @stuartclark 
>>
>> I have sent mistakenly a private message to you.
>>
>> In case other users can also follow, I have two Traefik instances and 
>> respectively I have defined two jobs for them in my prometheus.yml .
>>
>> So I'm able to reach the jobs in the dashboard's setting by: 
>> label_value(job)
>> But a combination like label_values(service, job) doesn't work and I'm 
>> still getting all services. Please check the pic:
>>
>> [image: Bildschirmfoto 2021-11-26 um 15.45.19.png]
>>
>> I'm sort of looking for an AND between the job_name and the services 
>> related to the specific job.
>>
>>
>> On Friday, November 26, 2021 at 3:27:17 PM UTC+1 Stuart Clark wrote:
>>
>>> On 26/11/2021 14:08, Mohammad Khoschnasar wrote: 
>>> > Hi all, 
>>> > 
>>> > I'm a newbie in prometheus. So go easy on me please. 
>>> > 
>>> > So I have two apps with similar metrics, which I want to scrape 
>>> > metrics to prometheus. My prometheus is installed on OS (no k8s). I 
>>> > have defined jobs for these two apps in my prometheus.yml and then 
>>> > defined another datasource in grafana. 
>>> > 
>>> > The problem is that metrics are being mixed, because they're coming to 
>>> > one prometheus datasource(I have no idea how to route the metrics for 
>>> > second app to the second datasource). 
>>> > 
>>> > I also tried to separate them into different dashboards with the help 
>>> > of adding query (instance) to the PromQL section in grafana, but no 
>>> > luck. I don't know if this is the right thing to do. 
>>> > 
>>> > So please someone explain to me, how this situations in real world 
>>> works. 
>>> > 
>>> A datasource in Grafana is for connecting to a particular Prometheus 
>>> instance, so in your case you'd only have a single one as you only have 
>>> one Prometheus server. 
>>>
>>> You can then use PromQL to query your metrics. Each job automatically 
>>> gets both instance & job labels added, so you'd be able to differentiate 
>>> between your two apps. 
>>>
>>> -- 
>>> Stuart Clark 
>>>
>>> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>

-- 
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/0f444acc-b3c5-4168-a5c5-a0e6910fc615n%40googlegroups.com.

Reply via email to