Remote write to your central store is falling further behind every hour. How do you handle it?
AdvancedScenarioLong-Term Storage, Scale and Cost
Answer
Situation read → Prometheus is ingesting faster than it can send. If lag exceeds the WAL window (~2 hours), data is lost for the remote store.
What I'd do →
- Measure the lag and shard behaviour:
prometheus_remote_storage_highest_timestamp_in_seconds - ignoring(remote_name, url) group_right prometheus_remote_storage_queue_highest_sent_timestamp_seconds prometheus_remote_storage_shards_desired / prometheus_remote_storage_shards_max rate(prometheus_remote_storage_samples_failed_total[5m]) - If
shards_desiredexceedsmax_shards, raise it and tune batches:queue_config: { max_shards: 100, capacity: 10000, max_samples_per_send: 2000 } - Check the receiver: 429s mean tenant rate limits; 5xx mean the backend is overloaded.
- Reduce what you send:
write_relabel_configsto drop unused metrics. - Check network latency between regions; remote write is sensitive to round-trip time.
Why → Each shard sends one request at a time, so throughput = shards × batch size / latency.
Interview tip → Alert on remote write lag above a few minutes, not only on failures.
More on Long-Term Storage, Scale and Cost
Prometheus keeps 15 days of data, but leadership wants 13 months of metrics for capacity planning. What do you build?IntermediateThe Thanos compactor has halted and the bucket keeps growing. What do you do?AdvancedGrafana shows every series twice after you added a second Prometheus replica with Thanos. How do you fix it?IntermediateMimir rejects writes from a team with `err-mimir-max-series-per-user`. What do you do?IntermediateYour observability SaaS bill tripled in a quarter, driven by custom metrics. How do you bring it down?IntermediateYou must choose between Thanos and Mimir for a new long-term metrics platform. How do you decide?Advanced