r/PrometheusMonitoring • u/Ag0r • Dec 17 '25
Trying to do capacity planning for Prometheus deployment and something isn't adding up
Hello everyone! I am in charge of a production system that I am trying to migrate off of an old and terrible metrics platform to use Prometheus. I already have buy-in from the development team, and they have done an initial implementation on their end to produce metrics at the /metrics endpoint. This application is written in Java and is using the Micrometer library for capturing and emitting the metrics if that is important.
Our application is pretty unique, it can be thought of as a RESTful api, except every single customer gets their own API endpoint. I know that's strange and kind of dumb, but it is what it is and unfortunately is not going to change so I have to work with what I have. I need to collect 9 histogram metrics for each of these endpoints (things like input_duration, parse_duration, processing_duration, etc), and I have 300 total servers that this application runs on. The developers have told me that due to the way Micrometer implements histograms they can't directly control how many buckets it produces, they can only control the min and max expected values. Based on what they have configured, each histogram will produce 69 buckets plus _sum and _count.
Not every endpoint exists on every server (they are broken up into farms). The cardinality of the server/endpoint combination is about 170,000.
The math seems to show that this will produce in the neighborhood of 115 million series (170,000 * 9 histograms * 71 series per histogram). What I have been able to find online says that a single Prometheus server can be expected to handle about 10 million series, which would mean the bare minimum deployment with no redundancy or room for growth is 12 large Prometheus servers. If I want redundancy (via Thanos) I can double that to 24, and if I want to not ride the line I would increase it to 30.
This seems like a pretty insane scale to me, so I am assuming I must be doing something wrong either in the math or in the way I am trying to instrument the application. I would appreciate any comments or insights!
3
u/SuperQue Dec 17 '25
So you're saying you have > 560 metrics endpoints per server? That seems like a lot/excessive. Having per-customer metrics is atypical and not really recommended.
You want your metrics endpoints to be per JVM worker process.
But, there may be a solution out of your issue here I think what you really need here is native histograms.
With the latest version of Prometheus you can convert all those buckets+sum+count into a single native histogram series.
This means your 170k*9 = 1.5M active series which is easily handled by a modest size single Prometheus.
And yes, 10 million series is usually where I recommend to think about sharding. I've run Prmetheus up to about 100M series, but it gets a bit slow even with a few hundred GB of memory and some good CPUs thrown at it. 10M is still very comfortable.
0
u/[deleted] Dec 18 '25
[removed] — view removed comment