Skip to content

Commit 8011bfe

Browse files
author
Julien Pivotto
authored
Add a note about remote read in HA Pair handling (#4500)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
1 parent 380af11 commit 8011bfe

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/guides/ha-pair-handling.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,39 @@ distributor:
7272
For further configuration file documentation, see the [distributor section](../configuration/config-file-reference.md#distributor_config) and [Ring/HA Tracker Store](../configuration/arguments.md#ringha-tracker-store).
7373

7474
For flag configuration, see the [distributor flags](../configuration/arguments.md#ha-tracker) having `ha-tracker` in them.
75+
76+
## Remote Read
77+
78+
If you plan to use remote_read, you can't have the `__replica__` label in the
79+
external section. Instead, you will need to add it only on the remote_write
80+
section of your prometheus.yml.
81+
82+
```
83+
global:
84+
external_labels:
85+
cluster: prom-team1
86+
remote_write:
87+
- url: https://cortex/api/v1/push
88+
write_relabel_configs:
89+
- target_label: __replica__
90+
replacement: 1
91+
```
92+
93+
and
94+
95+
```
96+
global:
97+
external_labels:
98+
cluster: prom-team1
99+
remote_write:
100+
- url: https://cortex/api/v1/push
101+
write_relabel_configs:
102+
- target_label: __replica__
103+
replacement: replica2
104+
```
105+
106+
When Prometheus is executing remote read queries, it will add the external
107+
labels to the query. In this case, if it asks for the `__replica__` label,
108+
Cortex will not return any data.
109+
110+
Therefore, the `__replica__` label should only be added for remote write.

0 commit comments

Comments
 (0)