From b23d0c3e353b817491e08566cf9f65074a229985 Mon Sep 17 00:00:00 2001 From: Nikolay Andreev <32139015+nickandreev@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:15:03 +0200 Subject: [PATCH] docs: add info about remotewrite client config in ruler --- docs/sources/operations/recording-rules.md | 15 +++++++++++++++ docs/sources/shared/configuration.md | 4 +++- pkg/ruler/config.go | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/sources/operations/recording-rules.md b/docs/sources/operations/recording-rules.md index fd5b8ae6cd5b..cd7bdd2d301c 100644 --- a/docs/sources/operations/recording-rules.md +++ b/docs/sources/operations/recording-rules.md @@ -74,6 +74,21 @@ so a `Persistent Volume` should be utilised. ## Remote-Write +### Client configuration + +Remote-write client configuration is fully compatible with [prometheus configuration format](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write). + +```yaml +remote_write: + clients: + mimir: + url: http://mimir/api/v1/push + write_relabel_configs: + - action: replace + target_label: job + replacement: loki-recording-rules +``` + ### Per-Tenant Limits Remote-write can be configured at a global level in the base configuration, and certain parameters tuned specifically on diff --git a/docs/sources/shared/configuration.md b/docs/sources/shared/configuration.md index 9ee288b49370..96fef2cc19bb 100644 --- a/docs/sources/shared/configuration.md +++ b/docs/sources/shared/configuration.md @@ -4827,7 +4827,9 @@ remote_write: # Deprecated: Use 'clients' instead. Configure remote write client. [client: ] - # Configure remote write clients. A map with remote client id as key. + # Configure remote write clients. A map with remote client id as key. For + # details, see + # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write [clients: ] # Enable remote-write functionality. diff --git a/pkg/ruler/config.go b/pkg/ruler/config.go index 69293b91324a..205fdd2c6f1c 100644 --- a/pkg/ruler/config.go +++ b/pkg/ruler/config.go @@ -53,7 +53,7 @@ func (c *Config) Validate() error { type RemoteWriteConfig struct { Client *config.RemoteWriteConfig `yaml:"client,omitempty" doc:"deprecated|description=Use 'clients' instead. Configure remote write client."` - Clients map[string]config.RemoteWriteConfig `yaml:"clients,omitempty" doc:"description=Configure remote write clients. A map with remote client id as key."` + Clients map[string]config.RemoteWriteConfig `yaml:"clients,omitempty" doc:"description=Configure remote write clients. A map with remote client id as key. For details, see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write"` Enabled bool `yaml:"enabled"` ConfigRefreshPeriod time.Duration `yaml:"config_refresh_period"` AddOrgIDHeader bool `yaml:"add_org_id_header" doc:"description=Add X-Scope-OrgID header in remote write requests."`