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

feat(quotas): Rate limit metrics before aggregator [INGEST-1655] #1540

Merged

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Oct 24, 2022

Background

In #1515 we implemented rate limiting functionality for metrics buckets, which are applied after flushing them from the metrics aggregator by checking redis.

This PR

When a quota is already exhausted, and that information has already been cached on the project state, there is no need to go through the aggregator at all. Instead, we apply the rate limiting logic before sending metrics or buckets into the aggregator.

Implementation details

The utility type BucketLimiter was converted to a generic MetricsLimiter<T>, where T can be either Metric or Bucket.

Notes

Will be merged into #1537 & deployed together.

#skip-changelog (there's already a line about rate limiting metrics buckets)

@jjbayer jjbayer marked this pull request as ready for review October 24, 2022 06:47
@jjbayer jjbayer requested a review from a team October 24, 2022 06:47
Copy link
Contributor

@olksdr olksdr left a comment

Choose a reason for hiding this comment

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

lgtm

@jjbayer jjbayer changed the base branch from master to feat/indexed-transactions-limiting October 24, 2022 09:28
@jjbayer jjbayer merged commit 139fa35 into feat/indexed-transactions-limiting Oct 24, 2022
@jjbayer jjbayer deleted the feat/quotas-rate-limit-before-agg branch October 24, 2022 11:22
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.

3 participants