-
Notifications
You must be signed in to change notification settings - Fork 543
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
Introduce single forward endpoint to simplify configuration. #2801
Conversation
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
defer closeFn() | ||
|
||
rules := validation.ForwardingRules{ | ||
"metric1": validation.ForwardingRule{Ingest: false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we make one rule specify an invalid forwarding target, to check that it gets overridden by the one passed into Forward()
?
"metric1": validation.ForwardingRule{Ingest: false}, | |
"metric1": validation.ForwardingRule{Ingest: false, Endpoint: "invalid"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for working on it Peter!
…ot used. Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@@ -159,7 +160,8 @@ type Limits struct { | |||
AlertmanagerMaxAlertsCount int `yaml:"alertmanager_max_alerts_count" json:"alertmanager_max_alerts_count"` | |||
AlertmanagerMaxAlertsSizeBytes int `yaml:"alertmanager_max_alerts_size_bytes" json:"alertmanager_max_alerts_size_bytes"` | |||
|
|||
ForwardingRules ForwardingRules `yaml:"forwarding_rules" json:"forwarding_rules" doc:"nocli|description=Rules based on which the Distributor decides whether a metric should be forwarded to an alternative remote_write API endpoint."` | |||
ForwardingEndpoint string `yaml:"forwarding_endpoint" json:"forwarding_endpoint" doc:"nocli|description=Remote-write endpoint where metrics specified in forwarding_rules are forwarded to. If set, takes precedence over endpoints specified in forwarding rules."` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "nocli"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point we're moving it from per-rule to per-tenant, hence nocli
. But I agree that it could be useful to set it globally too in some situations. Let's tackle that when we remove per-rule endpoints.
(nocli
doesn't prevent this to be used globally via config file of course)
What this PR does
This PR adds
forwarding_endpoint
to per-tenant limits, which takes precedence over forwarding-rule-specific endpoints. Endpoints in forwarding rules will be removed next.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]