Installations · By Ram ·
Scaling Beyond 800 Targets: Prometheus & Grafana's Breaking Points
We hit some hard limits with Prometheus and Grafana once our monitored targets crossed 800. From cardinality explosions to federation woes, here's what actually broke and how we fixed it.

Scaling Beyond 800 Targets: Prometheus & Grafana's Breaking Points
When I joined the team back in late 2018, our Prometheus and Grafana setup was handling about 150 targets across two data centers beautifully. We were all pretty confident in our monitoring story. Fast forward 18 months and a significant infrastructure expansion, we were approaching 850 targets, and our once-reliable monitoring stack was constantly on fire. We learned some hard lessons about cardinality, federation, and the true cost of easy metrics.
The Cardinality Bomb that Bit Us in Week Three
The first major issue, and the one that landed me on a three-day, sleep-deprived pager rotation, was a cardinality explosion. We deployed a new service mesh (Istio 1.1.7 at the time) that, by default, exposed metrics with an absurd number of labels, including full request URLs and container IDs. Within 72 hours of deploying Istio to our 120-node Kubernetes cluster, our main Prometheus server's resource utilization shot up. Disk I/O was constantly 100%, and RAM usage jumped from 16GB to 60GB on a machine provisioned with 64GB. Scrapes started failing, alerts stopped firing reliably, and our 3-week old Prometheus instance was effectively dead.

Our Initial Fix: Relabeling and Exclusions
It was clear we couldn't ingest everything. Our immediate action was to implement aggressive relabeling rules in Prometheus to drop high-cardinality labels. We focused on `kubernetes_pod_name`, `container_id`, and `request_path` for certain metrics. For some Istio metrics, we opted to drop them entirely due to their inherent high cardinality with limited operational value at scale.
- job_name: 'kubernetes-pods'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_name]
regex: 'istio-proxy'
action: keep
- source_labels: [__name__]
regex: 'istio_requests_total|istio_request_duration_milliseconds'
action: keep
- source_labels: [__name__, request_path]
regex: 'istio_requests_total;/.*/v1/status.*'
action: drop
- source_labels: [instance, kubernetes_node_name, container_id]
regex: '^(.*)