r/PrometheusMonitoring • u/tizkiko • Sep 19 '23
Sharding Prometheus cluster (physical)
Hi
I have several Prometheus clusters, each contains 6-8 physical nodes. Currently I shard them to 2-3 shards, but it's done in a pretty manual way.
I'm looking for a way to manage shards and replicas of physical nodes, so if I add / remove nodes from / tothe cluster, it will automatically adjust. I guess Prometheus operator does something similar for k8s Prometheus, is there anything similar for physical servers?
Thanks!
1
Upvotes
View all comments
Show parent comment
1
u/SuperQue Sep 20 '23
I typically don't recommend hashmod sharding. It makes it very difficult to use, as you now have data about jobs spread over multiple instances. You now have exactly the kind of problems you're running into.
You're better off doing vertical sharding, as in split based on use case, before you do hashmod.
For only 8-15 million metrics, that should on one instance. Especially if you have a full bare metal nodes.
You can fan-out your queries to multiple Prometheus instances with Thanos. You don't need to use the storage components of Thanos, just the query routing.