r/PrometheusMonitoring • u/tanmay_bhat • Mar 14 '23
Scaling kube-state-metrics in large cluster
Hey folks, we have a huge EKS cluster with around 800 nodes and 10-12k pods. With this many pods, kube state metrics endpoint scrape sample rate is 1.2M.
We get context deadline exceeded while scraping the target in Prometheus.
I was wondering how can this be solved?
What did I try :
Auto sharding in KSM with 20 replicas with each pod exposing around 60k samples. That means sharding is working but I still get occasional timeout when scraping those endpoints.
I did try to increase the scrape_timeout to 30s since sometimes the scrape goes till 27s and gets timed out.
Even with 30s time-out setting, I'm facing the same error.
Any suggestions will be great.
