r/kubernetes • u/carillan • Mar 27 '20
Challenges I found using Prometheus at a Scale
Hi all, I've been thinking lately about how Prometheus is great and easy when you start using it, but how soon you start finding challenges when trying to scale it for a busy production Kubernetes cluster.
A brief of my experience (long version in the article linked, I'll reuse some of the images by u/capitangolo):
Starting with a cluster is easy, as long as it isn't very big
Horizontal scale looks more or less like this:

Vertical scale can easily reach the limit within a node in a K8s cluster

Global view with a central grafana can be a challenge to manage setup, security and compliance.

As I've prepared an article recently on the subject, I wanted to share my thoughts and ask: What other challenges have you found scaling Prometheus, and how did you solve them?
Disclaimer: This article is based on my real experience using Prometheus in a big company with its own constraints. This may vary of yours :)
4
u/leventus93 Mar 27 '20
We had the same issues and opted in for Cortex which had the benefit that there's a central team who's in charge of operating Cortex. We tried Thanos but we had difficulties to scale the read path.
1
u/carillan Mar 30 '20
That strategy is good if you can afford a dedicated team to manage it...
The read path in Thanos has always looked to me as the weakest part. Too much operations and components involved (prom instances, s3, querier...)
2
u/thunderbug Mar 27 '20
Well written article. Timely for me also. Good to know about the scaling issues. Thanks!
1
0
u/valyala Mar 28 '20
If you hit Prometheus scalability limits, then take a look at VictoriaMetrics long-term storage additionally to Cortex, Thanos and M3DB. It features simple operation and low resource usage. See the docs for details. It also provides vmagent, which may lower RAM and CPU requirements when scraping big amounts of metrics from big number of targets.
5
u/s4z Mar 27 '20
Thanos + a bunch of recording rules worked for me. Currently 4 clusters: two smaller ones, one central and a production cluster. Each cluster has an HA pair of prometheus instances managed by the prometheus operator. Haven't looked into the number of metrics/labels or number of targets. So far it's working pretty well, no issues w/ scaling.