-
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
Alertmanager: Add state size limit #9475
Conversation
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.
Should we add an entry to the changelog as you did in your last PR?
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.
LGTM 👍
@titolins is OoO, I'm fixing some issues (mostly conflicts with |
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.
Couple of spurious changes seem to have crept in.
@@ -169,8 +169,24 @@ func (am *MultitenantAlertmanager) SetUserGrafanaState(w http.ResponseWriter, r | |||
return | |||
} | |||
|
|||
payload, err := io.ReadAll(r.Body) | |||
var input io.Reader |
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.
We use the globalerror package for formatting errors returned to users in response to hitting limits. This gives each error a unique name with an associated entry in a runbook along with a message that describes how the limit can be adjusted. Can you please make use of that for this limit and the previously added limit for grafana config size?
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.
Ah, that's nice - tks for pointing it out. Adjusted now 👍
b74a1d7
to
c66df9e
Compare
squashing the commits to make rebasing easier since CHANGELOG changes are relatively common |
1fa4dfa
to
81ee011
Compare
81ee011
to
5b006c9
Compare
Should be good for another round. Squashed the previous review state in the first commit, all others are new 👍 |
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.
LGTM! Please take a look at my comments.
# Maximum size of the Grafana Alertmanager configuration for a tenant. 0 = no | ||
# limit. |
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.
Nit:
# Maximum size of the Grafana Alertmanager configuration for a tenant. 0 = no | |
# limit. | |
# Maximum size of the Grafana Alertmanager configuration for a tenant. 0 = no limit. |
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 file is auto-generate (make doc
)
@@ -3661,6 +3661,10 @@ The `limits` block configures default and per-tenant limits imposed by component | |||
# CLI flag: -alertmanager.max-config-size-bytes |
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.
Just two lines above this one, the old description for the config size limit should be fixed.
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 is the description of the remote AM configuration limit. I had copied the grafana config limit from this, that's why it's almost the same 😅
I've adjusted it now to keep the same wording for both
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
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.
Thanks for making that change!
Similar to #9402 , but for Grafana state
Fixes https://github.com/grafana/alerting-squad/issues/933