-
Notifications
You must be signed in to change notification settings - Fork 660
Usage group support for ingestion limits #3914
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
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.
LGTM!
91553fd
to
ed98441
Compare
matched := false | ||
for _, lbl := range lbls { | ||
if lbl.Name == m.Name && !m.Matches(lbl.Value) { | ||
return false | ||
if lbl.Name == m.Name { | ||
if !m.Matches(lbl.Value) { | ||
return false | ||
} | ||
matched = true | ||
break | ||
} | ||
} | ||
if !matched { | ||
return 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.
Unrelated to this PR, but when the request and usage group labels are disjoint, we report this as a match. This change makes sure we have a match on all usage group labels.
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.
* Apply ingestion limits to usage groups * Check actual usage groups in the request * Make test more robust * Fix case where usage groups can match against a disjoint set of request labels * Reduce nesting in checkUsageGroupsIngestLimit
Continuation of #3879, adding support for reacting to externally configured ingestion limits for usage groups. The config model is extended from before:
When the limit is reached, we add the usage group to the error response:
Usage groups use the global (tenant-level) period type and sampling config for simplicity, this might change in the future if needed.