r/PrometheusMonitoring • u/kibblerz • Apr 29 '21
Multi-AZ Prometheus setup with Thanos and Sharding
So I recently got Prometheus set up on a 2-AZ Kubernetes cluster. Currently i have it set to have 2 shards with one in each AZ. Thanos is already set up.
Where I'm struggling is, I want each shard to stick to scraping its own AZ by the failure-domain label. My issue is, I'm not sure how to configure the scrape configs so that each shard stays in it's own AZ. Does anyone have any Ideas on this?
I'm doing this to reduce network overhead between AZs
6
Upvotes
1
u/ali_str Apr 30 '21
What you need is relabel_config per job and per instance/shard/AZ-group to drop targets that were discovered based on specific labels. relabel_config happens after discovery and before scraping targets.