Skip to content
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

Merged
merged 6 commits into from
Aug 24, 2022

Conversation

pstibrany
Copy link
Member

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

  • Tests updated
  • [na] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@pstibrany pstibrany requested a review from replay August 22, 2022 15:58
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
defer closeFn()

rules := validation.ForwardingRules{
"metric1": validation.ForwardingRule{Ingest: false},
Copy link
Contributor

@replay replay Aug 23, 2022

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()?

Suggested change
"metric1": validation.ForwardingRule{Ingest: false},
"metric1": validation.ForwardingRule{Ingest: false, Endpoint: "invalid"},

Copy link
Contributor

@replay replay left a 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>
@pstibrany pstibrany enabled auto-merge (squash) August 24, 2022 07:47
@@ -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."`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "nocli"?

Copy link
Member Author

@pstibrany pstibrany Aug 24, 2022

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)

@pstibrany pstibrany merged commit ca5e6cb into main Aug 24, 2022
@pstibrany pstibrany deleted the single-forward-endpoint branch August 24, 2022 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants