Interview Prep/Monitoring & Observability/Long-Term Storage, Scale and Cost

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 →

  1. 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])
    
  2. If shards_desired exceeds max_shards, raise it and tune batches:
    queue_config: { max_shards: 100, capacity: 10000, max_samples_per_send: 2000 }
    
  3. Check the receiver: 429s mean tenant rate limits; 5xx mean the backend is overloaded.
  4. Reduce what you send: write_relabel_configs to drop unused metrics.
  5. 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.

All Monitoring & Observability questions

More on Long-Term Storage, Scale and Cost