Repository navigation
We have two Prometheus replicas deployed in one cluster, and only one of them performs Remote Write at any given time. Could anyone share how to implement this with the Operator? #8328
Replies: 1 comment
|
If I understand correctly, you want two Prometheus replicas for HA but only one doing remote_write at a time to avoid duplicates? The typical approach is to put a Thanos sidecar in front and let Thanos handle deduplication on the receiving end. Both replicas remote-write but the receiver deduplicates based on the apiVersion: monitoring.coreos.com/v1
kind: Prometheus
spec:
replicas: 2
replicaExternalLabelName: __replica__
remoteWrite:
- url: http://thanos-receive:19291/api/v1/receiveIf you really want only one replica to write (instead of both + dedup), you're basically looking at leader election, which Prometheus doesn't natively support for remote_write. Some people work around it with an external sidecar that checks a lease and toggles the remote_write config, but it's fragile. The dedup approach is way more common in practice. |
Uh oh!
There was an error while loading. Please reload this page.
We have two Prometheus replicas deployed in one cluster, and only one of them performs Remote Write at any given time. Could anyone share how to implement this with the Operator?
All reactions