-
Notifications
You must be signed in to change notification settings - Fork 223
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
[OPIK-68] Add rate limit #261
Conversation
apps/opik-backend/src/test/java/com/comet/opik/infrastructure/ratelimit/RateLimitE2ETest.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisRateLimitService.java
Outdated
Show resolved
Hide resolved
2e312b4
to
9e182bb
Compare
…m/comet-ml/opik into thiagohora/OPIK-68_add_rate_limit
9e182bb
to
1f35a9d
Compare
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.
In general, very well done!!! This is fine to go for the general case. But I left some comments as I believe this should have follow-up PRs in order to cover a few gaps. Also, there's one question that we need to decide and agree for the case of failed requests.
...opik-backend/src/main/java/com/comet/opik/infrastructure/ratelimit/RateLimitInterceptor.java
Outdated
Show resolved
Hide resolved
...opik-backend/src/main/java/com/comet/opik/infrastructure/ratelimit/RateLimitInterceptor.java
Outdated
Show resolved
Hide resolved
...opik-backend/src/main/java/com/comet/opik/infrastructure/ratelimit/RateLimitInterceptor.java
Outdated
Show resolved
Hide resolved
...opik-backend/src/main/java/com/comet/opik/infrastructure/ratelimit/RateLimitInterceptor.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisRateLimitService.java
Outdated
Show resolved
Hide resolved
...opik-backend/src/main/java/com/comet/opik/infrastructure/ratelimit/RateLimitInterceptor.java
Outdated
Show resolved
Hide resolved
…m/comet-ml/opik into thiagohora/OPIK-68_add_rate_limit
…m/comet-ml/opik into thiagohora/OPIK-68_add_rate_limit
Sorry, I found a typo |
* [OPIK-68] Add rate limit * Add tests * Add batch endpoint rate limit * Add new rate limit headers * Address PR feedback * Address PR feedback
Details
Add rate limit functionality.
Added
@RateLimited
annotation to apply rate limit to an endpoint.The following properties control the limit buckets (For now, only one
generalEvents
)In the case of batch operations, an interface called
RateEventContainer
allows the interceptor to know the number of items in the batch.When enabled, the rate limit is communicated via headers and status 429 (TOO_MANY_REQUESTS) when the limit is reached.
Issues
OPIK-68
Testing
Tested locally via Minikube setup and also via Component Tests in the pipeline.