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
--
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/6ff06c7a-deb5-067a-e6a7-547914764727%40Jahingo.com.