What is `remote_write` and how does it work internally?
AdvancedConceptPrometheus Architecture
Answer
remote_write streams samples to a remote endpoint (Mimir, Thanos Receive, Cortex, VictoriaMetrics, Amazon Managed Prometheus) as snappy-compressed protobuf. Prometheus tails its own WAL and sends via sharded queues that scale up and down with throughput.
remote_write:
- url: https://mimir.example.com/api/v1/push
queue_config:
max_shards: 50
capacity: 10000
max_samples_per_send: 2000
If the remote is down, data buffers in the WAL (about 2 hours). Watch prometheus_remote_storage_samples_pending and prometheus_remote_storage_highest_timestamp_in_seconds minus queue_highest_sent_timestamp_seconds for lag. Remote Write 2.0 adds metadata and exemplars natively.
More on Prometheus Architecture
Describe the Prometheus architecture.BeginnerWhat does a basic prometheus.yml look like?BeginnerWhat is the `up` metric?BeginnerWhat are `job` and `instance` labels and where do they come from?BeginnerHow is the Prometheus TSDB organized on disk?AdvancedWhat is the WAL and why does Prometheus restart slowly sometimes?Advanced