Skip to content

Commit

Permalink
docs: Add clarifications for ruler remote write config options (#15167)
Browse files Browse the repository at this point in the history
The update provides better understanding of the ruler remote write config behaviour. If a user specifies an 'X-Scope-OrgID' header under the 'headers' section of RemoteWriteConfig, the config parser silently drops this. This is not currently clear to the user and can lead to confusion. This update aims to clarify this.

It also adds clarification about what tenant ID value will be added to the 'X-Scope-OrgID' header in the remote write request if 'add_org_id_header' config parameter is set to 'true'.
  • Loading branch information
avanish-vaghela authored Jan 13, 2025
1 parent efd3ec3 commit a96a695
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/sources/shared/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4988,6 +4988,9 @@ remote_write:
# 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
# Specifying a header with key 'X-Scope-OrgID' under the 'headers' section of
# RemoteWriteConfig is not permitted. If specified, it will be dropped during
# config parsing.
[clients: <map of string to RemoteWriteConfig>]
# Enable remote-write functionality.
Expand All @@ -5000,7 +5003,8 @@ remote_write:
# CLI flag: -ruler.remote-write.config-refresh-period
[config_refresh_period: <duration> | default = 10s]
# Add X-Scope-OrgID header in remote write requests.
# Add an X-Scope-OrgID header in remote write requests with the tenant ID of a
# Loki tenant that the recording rules are part of.
# CLI flag: -ruler.remote-write.add-org-id-header
[add_org_id_header: <boolean> | default = true]
Expand Down
4 changes: 2 additions & 2 deletions pkg/ruler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ 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. For details, see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write"`
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 Specifying a header with key 'X-Scope-OrgID' under the 'headers' section of RemoteWriteConfig is not permitted. If specified, it will be dropped during config parsing."`
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."`
AddOrgIDHeader bool `yaml:"add_org_id_header" doc:"description=Add an X-Scope-OrgID header in remote write requests with the tenant ID of a Loki tenant that the recording rules are part of."`
}

func (c *RemoteWriteConfig) Validate() error {
Expand Down

0 comments on commit a96a695

Please sign in to comment.