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

Distributor ingestion limits #3879

Merged
merged 7 commits into from
Feb 4, 2025
Merged

Distributor ingestion limits #3879

merged 7 commits into from
Feb 4, 2025

Conversation

aleks-p
Copy link
Contributor

@aleks-p aleks-p commented Jan 31, 2025

Adds a way for distributors to stop allowing requests through, controlled via a tenant override. The tenant override is defined as:

ingestion_limit:
  period_type: hour
  period_limit_mb: 1024
  limit_reached: true
  next_limit_reset: 1738274400
  sampling:
    num_requests: 1
    period: 2m

For now, an external system will manage the tenant overrides, in the future we might create a special component for this. Once the limit is reached (ingestion_limit.limit_reached == true):

  • distributors will only let a few requests through, controlled via the sampling section in the config
  • for rejections, distributors will respond with an error containing more information:
    resource_exhausted: limit of 1 GiB/hour reached, next reset at 2025-01-30T22:00:00Z

@aleks-p aleks-p requested review from a team as code owners January 31, 2025 18:40
@aleks-p aleks-p force-pushed the distributor-ingestion-limits branch from d425ca6 to 44483c4 Compare January 31, 2025 19:21
Copy link
Contributor

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM

I think sorting out the docs would be good, otherwise I think this is ready to go

@@ -2020,6 +2020,20 @@ The `limits` block configures default and per-tenant limits imposed by component
# CLI flag: -distributor.ingestion-burst-size-mb
[ingestion_burst_size_mb: <float> | default = 2]

ingestion_limit:
Copy link
Contributor

Choose a reason for hiding this comment

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

You can set an advanced or experimental struct tag, to not have it appear here.

Alternatively we should fill this with more description.

Mimir does that: https://github.com/grafana/mimir/blob/ae924bf9a2f373a600dce34c078a9602929dd480/pkg/util/validation/limits.go#L107

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

I just tried, the advanced and experimental category don't seem to make a difference (it still gets generated). Setting doc:"hidden" removes it which I think makes sense considering we will likely move this config to object storage.

@aleks-p aleks-p force-pushed the distributor-ingestion-limits branch from 44483c4 to 571ec08 Compare February 4, 2025 18:24
@aleks-p aleks-p merged commit 19dfa17 into main Feb 4, 2025
19 checks passed
@aleks-p aleks-p deleted the distributor-ingestion-limits branch February 4, 2025 19:12
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.

2 participants