Skip to content

Add a note about remote read in HA Pair handling #4500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/guides/ha-pair-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,39 @@ distributor:
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).

For flag configuration, see the [distributor flags](../configuration/arguments.md#ha-tracker) having `ha-tracker` in them.

## Remote Read

If you plan to use remote_read, you can't have the `__replica__` label in the
external section. Instead, you will need to add it only on the remote_write
section of your prometheus.yml.

```
global:
external_labels:
cluster: prom-team1
remote_write:
- url: https://cortex/api/v1/push
write_relabel_configs:
- target_label: __replica__
replacement: 1
```

and

```
global:
external_labels:
cluster: prom-team1
remote_write:
- url: https://cortex/api/v1/push
write_relabel_configs:
- target_label: __replica__
replacement: replica2
```

When Prometheus is executing remote read queries, it will add the external
labels to the query. In this case, if it asks for the `__replica__` label,
Cortex will not return any data.

Therefore, the `__replica__` label should only be added for remote write.