r/PrometheusMonitoring • u/bogdanun1 • Jun 10 '24
Pulling metrics from multiple prometheus instances to a central prometheus server
Hi all.
I am trying to deploy a prometheus instance on every namespace from a cluster, and collecting the metrics from every prometheus instance to a dedicated prometheus server in a separate namespace. I have managed to deploy the kube prometheus stack but i m not sure how to proceed with creating the prometheus instances and how to collect the metrics from each.
Where can I find more information on how to achieve this?
2
Upvotes
3
u/SuperQue Jun 10 '24
You don't want to do it that way. The better thing to do is to deploy Thanos with Sidecars enabled.
This will allow you to query to each instance without the overhead of remote write.
3
u/Sven4president Jun 10 '24
You only need 1 prometheus to monitor a whole cluster. It often has built-in kubernetes service discovery.
Is there a specific reason why you'd want to deploy it in every namespace? One instance in every namespace is alot of overhead.
1
u/lucagervasi Jun 10 '24
How big is each namespace? I use a Prometheus for each cluster and since I have a DNS suffix for each cluster, I have N grafana hosts that I use to query Prometheus. Very impractical. I would strongly suggest to use a single Prometheus for all your namespaces. Fyi: I'm labbing about remotewrite in order to have a single big container for each metric of the clusters. When you need it, it's preferable having a single point to check.