Skip to content

Rate Limiter: Enable rate limit for month and year#6715

Merged
arkodg merged 5 commits intoenvoyproxy:mainfrom
commoddity:rate-limit-month-year
Aug 6, 2025
Merged

Rate Limiter: Enable rate limit for month and year#6715
arkodg merged 5 commits intoenvoyproxy:mainfrom
commoddity:rate-limit-month-year

Conversation

@commoddity
Copy link
Copy Markdown
Contributor

@commoddity commoddity commented Aug 6, 2025

This PR enables month and year as rate limiting units in addition to the existing units.

Changes

  • Updated rate limiter to support month and year time units
  • Added support for month/year in rate limit configuration
  • Updated Go control plane rate limiter version to include month/year support
  • Added comprehensive tests for month and year rate limiting

Test Data

  • Added test cases for month and year rate limiting rules
  • Verified functionality with both global rate limiting scenarios

This enhancement allows users to configure rate limits with longer time windows, which is useful for scenarios requiring monthly or yearly quotas.

Fixes: Rate limiting with month and year units

🙌 NOTE 🙌
Thanks to @rpahli for the initial work on this PR which is the majority of the work done here; I just updated the go-control-plane which fixed the failing tests.

@commoddity commoddity requested a review from a team as a code owner August 6, 2025 10:20
@commoddity commoddity changed the title Enable rate limit for month and year Rate Limiter: Enable rate limit for month and year Aug 6, 2025
Pascal van Leeuwen added 2 commits August 6, 2025 11:59
Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
@commoddity commoddity force-pushed the rate-limit-month-year branch from c506b3d to bbacb1a Compare August 6, 2025 11:04
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 6, 2025

thanks for taking this forward @commoddity,
could you add Signed-off-by: Rico Pahlisch <pahli88@googlemail.com> to the commit for formal attribution to @rpahli

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.06%. Comparing base (958ef7a) to head (9d08fde).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/utils/ratelimit/unit.go 0.00% 4 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6715      +/-   ##
==========================================
+ Coverage   71.04%   71.06%   +0.02%     
==========================================
  Files         224      224              
  Lines       39615    39619       +4     
==========================================
+ Hits        28144    28155      +11     
+ Misses       9812     9806       -6     
+ Partials     1659     1658       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

arkodg
arkodg previously approved these changes Aug 6, 2025
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@arkodg arkodg requested review from a team August 6, 2025 15:02
@arkodg arkodg added this to the v1.5.0 Release milestone Aug 6, 2025
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 6, 2025

gen-check is still failing, can you run make generate && make manifests && make testdata

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
@commoddity commoddity force-pushed the rate-limit-month-year branch from 12113bf to 9a82610 Compare August 6, 2025 18:15
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 6, 2025

@commoddity can you rm the binaries added in the gateway-addons-helm path ?

@commoddity
Copy link
Copy Markdown
Contributor Author

@commoddity can you rm the binaries added in the gateway-addons-helm path ?

I've removed them. Sorry about that; seems it was something my local Helm did on its own.

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
@commoddity commoddity force-pushed the rate-limit-month-year branch from 0c0bd6c to 9d08fde Compare August 6, 2025 18:45
@arkodg arkodg requested review from a team August 6, 2025 18:50
@arkodg arkodg merged commit 54ca0d3 into envoyproxy:main Aug 6, 2025
30 of 33 checks passed
zirain pushed a commit to zirain/gateway that referenced this pull request Aug 8, 2025
* update go control plane rate limiter version

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* enable rate limit for month and year

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* add attribution

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* fix gen

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* remove helm binaries

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

---------

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
zirain added a commit that referenced this pull request Aug 8, 2025
* docs: rm latest from install egctl docs (#6700)

* we've removed the latest egctl artifacts

Relates to #6551

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore: fix globalResources in GNM (#6701)

Signed-off-by: zirain <zirain2009@gmail.com>

* move ordering gateway-api resources to provider (#6695)

Signed-off-by: zirain <zirain2009@gmail.com>

* Rate Limiter: Enable rate limit for month and year (#6715)

* update go control plane rate limiter version

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* enable rate limit for month and year

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* add attribution

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* fix gen

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* remove helm binaries

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

---------

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: rm alpha alert for gateway namespace mode (#6709)

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* allow SNI and Cert SAN mismatch (#6719)

Fixes: #6442

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore(charts): update metadata for gateway-crds-helm (#6725)

* chore(charts): update metadata for gateway-crds-helm

Signed-off-by: Maxime Brunet <max@brnt.mx>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore: Don't render bootstrap local cluster if topologyInjector is disabled (#6718)

* Consider topologyInjector when rendering bootstrap

Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>

* Add logic to provider

Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
Signed-off-by: zirain <zirain2009@gmail.com>

* remove nit log when Backend API is disabled (#6708)

* remove nit log when Backend API is disabled

Signed-off-by: zirain <zirain2009@gmail.com>

* fix: EnvoyProxy image with digest is rejected (#6720)

* fix: EnvoyProxy image with digest is rejected

Signed-off-by: zirain <zirain2009@gmail.com>

* Revert "feat: add listener metadata (#6639)" (#6727)

This reverts commit 20cb68b.

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: enhance extensibility index page (#6728)

make it easier to pick the relevant extension type

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: add docs explaining graceful shutdown (#6729)

* docs: add docs explaining graceful shutdown

fixes: #2686

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: ClusterTrustBundle Support in BackendTLSPolicy (#6714)

Signed-off-by: zirain <zirain2009@gmail.com>

* chore: bump go 1.24.6 (#6732)

Signed-off-by: zirain <zirain2009@gmail.com>

* [release-1.5] release-notes for v1.5.0 (#6731)

* [release-1.5] release-notes for v1.5.0

Signed-off-by: zirain <zirain2009@gmail.com>

* update compatibility matrix

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Signed-off-by: Maxime Brunet <max@brnt.mx>
Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com>
Co-authored-by: commoddity <47662958+commoddity@users.noreply.github.com>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Co-authored-by: Maxime Brunet <max@brnt.mx>
Co-authored-by: Isaac <10012479+jukie@users.noreply.github.com>
zirain added a commit to zirain/gateway that referenced this pull request Sep 16, 2025
* docs: rm latest from install egctl docs (envoyproxy#6700)

* we've removed the latest egctl artifacts

Relates to envoyproxy#6551

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore: fix globalResources in GNM (envoyproxy#6701)

Signed-off-by: zirain <zirain2009@gmail.com>

* move ordering gateway-api resources to provider (envoyproxy#6695)

Signed-off-by: zirain <zirain2009@gmail.com>

* Rate Limiter: Enable rate limit for month and year (envoyproxy#6715)

* update go control plane rate limiter version

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* enable rate limit for month and year

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* add attribution

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* fix gen

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

* remove helm binaries

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>

---------

Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: rm alpha alert for gateway namespace mode (envoyproxy#6709)

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* allow SNI and Cert SAN mismatch (envoyproxy#6719)

Fixes: envoyproxy#6442

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore(charts): update metadata for gateway-crds-helm (envoyproxy#6725)

* chore(charts): update metadata for gateway-crds-helm

Signed-off-by: Maxime Brunet <max@brnt.mx>
Signed-off-by: zirain <zirain2009@gmail.com>

* chore: Don't render bootstrap local cluster if topologyInjector is disabled (envoyproxy#6718)

* Consider topologyInjector when rendering bootstrap

Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>

* Add logic to provider

Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
Signed-off-by: zirain <zirain2009@gmail.com>

* remove nit log when Backend API is disabled (envoyproxy#6708)

* remove nit log when Backend API is disabled

Signed-off-by: zirain <zirain2009@gmail.com>

* fix: EnvoyProxy image with digest is rejected (envoyproxy#6720)

* fix: EnvoyProxy image with digest is rejected

Signed-off-by: zirain <zirain2009@gmail.com>

* Revert "feat: add listener metadata (envoyproxy#6639)" (envoyproxy#6727)

This reverts commit 20cb68b.

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: enhance extensibility index page (envoyproxy#6728)

make it easier to pick the relevant extension type

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: add docs explaining graceful shutdown (envoyproxy#6729)

* docs: add docs explaining graceful shutdown

fixes: envoyproxy#2686

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>

* docs: ClusterTrustBundle Support in BackendTLSPolicy (envoyproxy#6714)

Signed-off-by: zirain <zirain2009@gmail.com>

* chore: bump go 1.24.6 (envoyproxy#6732)

Signed-off-by: zirain <zirain2009@gmail.com>

* [release-1.5] release-notes for v1.5.0 (envoyproxy#6731)

* [release-1.5] release-notes for v1.5.0

Signed-off-by: zirain <zirain2009@gmail.com>

* update compatibility matrix

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: Pascal van Leeuwen <pascal@grove.city>
Signed-off-by: Maxime Brunet <max@brnt.mx>
Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com>
Co-authored-by: Arko Dasgupta <arkodg@users.noreply.github.com>
Co-authored-by: commoddity <47662958+commoddity@users.noreply.github.com>
Co-authored-by: Rico Pahlisch <pahli88@googlemail.com>
Co-authored-by: Maxime Brunet <max@brnt.mx>
Co-authored-by: Isaac <10012479+jukie@users.noreply.github.com>
Signed-off-by: zirain <zirain2009@gmail.com>
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.

4 participants