Workloads in private VPCs cannot be scraped from your central Prometheus. What architecture do you use?
AdvancedScenarioPrometheus and PromQL at Scale
Answer
Situation read → Pull from a central location is blocked by network boundaries. Move collection to the edge and push outward.
What I'd do →
- Run a lightweight local collector per VPC or cluster: Prometheus in agent mode (
--enable-feature=agent, or--agentin Prometheus 3.x), Grafana Alloy, or the OpenTelemetry Collector. - It scrapes locally and remote_writes to a central Mimir/Thanos Receive/VictoriaMetrics over outbound HTTPS only.
- Authenticate with per-tenant tokens or mTLS, and add
external_labels(cluster,region). - Size the WAL and queue so a network outage of a few hours does not drop data (
queue_config.capacity,max_shards). - Alert on
prometheus_remote_storage_samples_failed_total.
Why → Outbound-only egress satisfies strict firewall policies and the agent keeps local state minimal.
Interview tip → Agent mode has no local querying or alerting, so keep rule evaluation central (Mimir ruler).
More on Prometheus and PromQL at Scale
Prometheus memory has grown to 60 GB and keeps climbing. How do you find the cause?IntermediateA developer added `user_id` as a metric label. What is the problem and what do you advise?BeginnerYour dashboard shows the average of per-pod p99 latencies. Why is it wrong, and how do you compute a correct fleet-wide p99?IntermediateChoose histogram bucket boundaries for a service with a 300 ms latency SLO.AdvancedYou have 500 short-lived batch jobs that finish before Prometheus can scrape them. How do you capture their metrics?IntermediateYour EC2 fleet autoscales constantly. How do you keep Prometheus targets up to date?Intermediate