I have reached moment when I need to split my prometheus into smaller ones. I have been reading about it here but it does not say anything about scaling in kubernetes. Below is my setup:
- one node of prometheus
- one node of kube state metrics
- node exporter on each cluster node
and there are about 50 namespaces which produces thousands of metrics and one current setup with one prometheus is not enough. So I decided to split it to three instances like:
- one for kube state metrics metrics
- one for node exporter metrics
- one for kubernetes metrics
But after while i realised that those metrics are scraped by kubernetes_sd_config and there is no way to tell which metrics I want to scrape by which instance of prometheus or I am wrong. One solution would be to split kubernetes cluster into smaller one but it is too much work for now.
So my question is if there is any possibility to tell prometheus that I want scrape only kube state metrics, node exporter or native kubernetes metrics ?
Scaling in Kubernetes is the same as elsewhere. This is a question of using service discovery and relabelling to pick out what is monitored.
For example the configuration for the node exporters should already be a separate scrape_config so splitting it out to a separate Prometheus should be straightforward by splitting the configuration file.